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
909a8443
Commit
909a8443
authored
Sep 09, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shuffle config around a bit
parent
9c6ed296
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
15 deletions
+9
-15
lib/gitlab/ldap/auth_hash.rb
lib/gitlab/ldap/auth_hash.rb
+5
-8
lib/gitlab/ldap/user.rb
lib/gitlab/ldap/user.rb
+3
-4
lib/gitlab/o_auth/auth_hash.rb
lib/gitlab/o_auth/auth_hash.rb
+1
-3
No files found.
lib/gitlab/ldap/auth_hash.rb
View file @
909a8443
...
@@ -3,17 +3,10 @@
...
@@ -3,17 +3,10 @@
module
Gitlab
module
Gitlab
module
LDAP
module
LDAP
class
AuthHash
<
Gitlab
::
OAuth
::
AuthHash
class
AuthHash
<
Gitlab
::
OAuth
::
AuthHash
attr_accessor
:config
def
initialize
(
auth_hash
,
config
)
super
(
auth_hash
)
@config
=
config
end
private
private
def
get_info
(
key
)
def
get_info
(
key
)
raw_key
=
config
.
attributes
[
key
]
raw_key
=
ldap_
config
.
attributes
[
key
]
return
super
unless
raw_key
return
super
unless
raw_key
value
=
value
=
...
@@ -35,6 +28,10 @@ module Gitlab
...
@@ -35,6 +28,10 @@ module Gitlab
def
get_raw
(
key
)
def
get_raw
(
key
)
auth_hash
.
extra
[
:raw_info
][
key
]
auth_hash
.
extra
[
:raw_info
][
key
]
end
end
def
ldap_config
@ldap_config
||=
Gitlab
::
LDAP
::
Config
.
new
(
self
.
provider
)
end
end
end
end
end
end
end
lib/gitlab/ldap/user.rb
View file @
909a8443
...
@@ -68,13 +68,12 @@ module Gitlab
...
@@ -68,13 +68,12 @@ module Gitlab
Gitlab
::
LDAP
::
Access
.
allowed?
(
gl_user
)
Gitlab
::
LDAP
::
Access
.
allowed?
(
gl_user
)
end
end
def
ldap_config
(
provider
=
auth_hash
.
provider
)
def
ldap_config
Gitlab
::
LDAP
::
Config
.
new
(
provider
)
Gitlab
::
LDAP
::
Config
.
new
(
auth_hash
.
provider
)
end
end
def
auth_hash
=
(
auth_hash
)
def
auth_hash
=
(
auth_hash
)
config
=
ldap_config
(
auth_hash
.
provider
)
@auth_hash
=
Gitlab
::
LDAP
::
AuthHash
.
new
(
auth_hash
)
@auth_hash
=
Gitlab
::
LDAP
::
AuthHash
.
new
(
auth_hash
,
config
)
end
end
end
end
end
end
...
...
lib/gitlab/o_auth/auth_hash.rb
View file @
909a8443
...
@@ -39,8 +39,6 @@ module Gitlab
...
@@ -39,8 +39,6 @@ module Gitlab
end
end
def
get_info
(
key
)
def
get_info
(
key
)
key
=
:nickname
if
key
==
:username
value
=
info
[
key
]
value
=
info
[
key
]
Gitlab
::
Utils
.
force_utf8
(
value
)
if
value
Gitlab
::
Utils
.
force_utf8
(
value
)
if
value
value
value
...
@@ -48,7 +46,7 @@ module Gitlab
...
@@ -48,7 +46,7 @@ module Gitlab
def
username_and_email
def
username_and_email
@username_and_email
||=
begin
@username_and_email
||=
begin
username
=
get_info
(
:username
)
username
=
get_info
(
:username
)
||
get_info
(
:nickname
)
email
=
get_info
(
:email
)
email
=
get_info
(
:email
)
username
||=
generate_username
(
email
)
if
email
username
||=
generate_username
(
email
)
if
email
...
...
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