Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
53816ef8
Commit
53816ef8
authored
Oct 10, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make AD check server specific
parent
1835fceb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-2
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
No files found.
config/initializers/1_settings.rb
View file @
53816ef8
...
...
@@ -55,9 +55,7 @@ end
# Default settings
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
.
ldap
[
'active_directory'
]
=
true
if
Settings
.
ldap
[
'active_directory'
].
nil?
# backwards compatibility, we only have one host
if
Settings
.
ldap
[
'enabled'
]
||
Rails
.
env
.
test?
...
...
@@ -69,6 +67,8 @@ if Settings.ldap['enabled'] || Rails.env.test?
end
Settings
.
ldap
[
'servers'
].
each
do
|
server
|
server
[
'allow_username_or_email_login'
]
=
false
if
server
[
'allow_username_or_email_login'
].
nil?
server
[
'active_directory'
]
=
true
if
server
[
'active_directory'
].
nil?
server
[
'provider_name'
]
=
"ldap
#{
server
[
'provider_id'
]
}
"
.
downcase
server
[
'provider_class'
]
=
OmniAuth
::
Utils
.
camelize
(
server
[
'provider_name'
])
end
...
...
lib/gitlab/ldap/access.rb
View file @
53816ef8
...
...
@@ -36,7 +36,7 @@ module Gitlab
def
allowed?
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
,
adapter
)
if
Gitlab
.
config
.
ldap
.
active_directory
if
ldap_config
.
active_directory
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
extern_uid
,
adapter
)
end
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment