Commit a5d7fc81 authored by Marin Jankovski's avatar Marin Jankovski

Make LDAP sync time configurable.

parent 2f8f0734
......@@ -419,7 +419,7 @@ class User < ActiveRecord::Base
if !Gitlab.config.ldap.enabled
false
elsif ldap_user?
!last_credential_check_at || (last_credential_check_at + 1.hour) < Time.now
!last_credential_check_at || (last_credential_check_at + Gitlab.config.ldap['sync_time']) < Time.now
else
false
end
......
......@@ -134,6 +134,12 @@ production: &base
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
# This setting is used to change how often LDAP group membership is updated.
# WARNING! Be advised that changing this setting can have severe performance consequences!
# Default: 1 hour.
# sync_time: 3600
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
......@@ -279,9 +285,9 @@ test:
port: 80
# When you run tests we clone and setup gitlab-shell
# In order to setup it correctly you need to specify
# In order to setup it correctly you need to specify
# your system username you use to run GitLab
# user: YOUR_USERNAME
# user: YOUR_USERNAME
satellites:
path: tmp/tests/gitlab-satellites/
gitlab_shell:
......
......@@ -57,6 +57,7 @@ end
Settings['ldap'] ||= Settingslogic.new({})
Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
Settings.ldap['allow_username_or_email_login'] = false if Settings.ldap['allow_username_or_email_login'].nil?
Settings.ldap['sync_time'] = 3600 if Settings.ldap['sync_time'].nil?
Settings['omniauth'] ||= Settingslogic.new({})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment