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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
7f350ba1
Commit
7f350ba1
authored
Jul 12, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract the finder portion of ldap_person so it can be overridden in EE
parent
2b827d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/gitlab/o_auth/user.rb
lib/gitlab/o_auth/user.rb
+7
-3
No files found.
lib/gitlab/o_auth/user.rb
View file @
7f350ba1
...
@@ -101,14 +101,18 @@ module Gitlab
...
@@ -101,14 +101,18 @@ module Gitlab
# Look for a corresponding person with same uid in any of the configured LDAP providers
# Look for a corresponding person with same uid in any of the configured LDAP providers
Gitlab
::
LDAP
::
Config
.
providers
.
each
do
|
provider
|
Gitlab
::
LDAP
::
Config
.
providers
.
each
do
|
provider
|
adapter
=
Gitlab
::
LDAP
::
Adapter
.
new
(
provider
)
adapter
=
Gitlab
::
LDAP
::
Adapter
.
new
(
provider
)
@ldap_person
=
Gitlab
::
LDAP
::
Person
.
find_by_uid
(
auth_hash
.
uid
,
adapter
)
@ldap_person
=
find_ldap_person
(
auth_hash
,
adapter
)
# The `uid` might actually be a DN. Try it next.
@ldap_person
||=
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
auth_hash
.
uid
,
adapter
)
break
if
@ldap_person
break
if
@ldap_person
end
end
@ldap_person
@ldap_person
end
end
def
find_ldap_person
(
auth_hash
,
adapter
)
by_uid
=
Gitlab
::
LDAP
::
Person
.
find_by_uid
(
auth_hash
.
uid
,
adapter
)
# The `uid` might actually be a DN. Try it next.
by_uid
||
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
auth_hash
.
uid
,
adapter
)
end
def
ldap_config
def
ldap_config
Gitlab
::
LDAP
::
Config
.
new
(
ldap_person
.
provider
)
if
ldap_person
Gitlab
::
LDAP
::
Config
.
new
(
ldap_person
.
provider
)
if
ldap_person
end
end
...
...
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