From 66c9297c367894d4f84b2e2ba2227e0019b3b6ec Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Sat, 27 Apr 2019 09:03:59 +0300 Subject: [PATCH] Feature: introduce LdapActiveSyncEnabled setting (#16787) * Feature: introduce LdapActiveSyncEnabled setting We probably remove it after the active sync is done. But at the moment we do not want to affect the current users with not fully tested feature * Chore: move settings in more logical order --- conf/defaults.ini | 2 +- pkg/setting/setting.go | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 61bc6af6dd8..c550e5bfdee 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -362,10 +362,10 @@ headers = enabled = false config_file = /etc/grafana/ldap.toml allow_sign_up = true -sync_cron = @hourly # LDAP backround sync (Enterprise only) sync_cron = @hourly +active_sync_enabled = false #################################### SMTP / Emailing ##################### [smtp] diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index d6a6ca5767d..0ed02f7f0ed 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -164,10 +164,11 @@ var ( GoogleTagManagerId string // LDAP - LdapEnabled bool - LdapConfigFile string - LdapSyncCron string - LdapAllowSignup = true + LdapEnabled bool + LdapConfigFile string + LdapSyncCron string + LdapAllowSignup bool + LdapActiveSyncEnabled bool // QUOTA Quota QuotaSettings @@ -971,10 +972,11 @@ type RemoteCacheOptions struct { func (cfg *Cfg) readLDAPConfig() { ldapSec := cfg.Raw.Section("auth.ldap") - LdapEnabled = ldapSec.Key("enabled").MustBool(false) LdapConfigFile = ldapSec.Key("config_file").String() - LdapAllowSignup = ldapSec.Key("allow_sign_up").MustBool(true) LdapSyncCron = ldapSec.Key("sync_cron").String() + LdapEnabled = ldapSec.Key("enabled").MustBool(false) + LdapActiveSyncEnabled = ldapSec.Key("active_sync_enabled").MustBool(false) + LdapAllowSignup = ldapSec.Key("allow_sign_up").MustBool(true) } func (cfg *Cfg) readSessionConfig() {