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
Kazuhiko Shiozaki
gitlab-ce
Commits
c4d487a7
Commit
c4d487a7
authored
Oct 20, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ldap-fixes' into 'master'
Ldap fixes Solves #1688 and #1686 See merge request !1193
parents
c5360a58
61d9d4e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
config/initializers/7_omniauth.rb
config/initializers/7_omniauth.rb
+2
-1
No files found.
config/initializers/1_settings.rb
View file @
c4d487a7
...
@@ -61,7 +61,6 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
...
@@ -61,7 +61,6 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
if
Settings
.
ldap
[
'enabled'
]
||
Rails
.
env
.
test?
if
Settings
.
ldap
[
'enabled'
]
||
Rails
.
env
.
test?
if
Settings
.
ldap
[
'host'
].
present?
if
Settings
.
ldap
[
'host'
].
present?
server
=
Settings
.
ldap
.
except
(
'sync_time'
)
server
=
Settings
.
ldap
.
except
(
'sync_time'
)
server
[
'label'
]
=
'LDAP'
server
[
'provider_name'
]
=
'ldap'
server
[
'provider_name'
]
=
'ldap'
Settings
.
ldap
[
'servers'
]
=
{
Settings
.
ldap
[
'servers'
]
=
{
'ldap'
=>
server
'ldap'
=>
server
...
@@ -69,6 +68,7 @@ if Settings.ldap['enabled'] || Rails.env.test?
...
@@ -69,6 +68,7 @@ if Settings.ldap['enabled'] || Rails.env.test?
end
end
Settings
.
ldap
[
'servers'
].
each
do
|
key
,
server
|
Settings
.
ldap
[
'servers'
].
each
do
|
key
,
server
|
server
[
'label'
]
||=
'LDAP'
server
[
'allow_username_or_email_login'
]
=
false
if
server
[
'allow_username_or_email_login'
].
nil?
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
[
'active_directory'
]
=
true
if
server
[
'active_directory'
].
nil?
server
[
'provider_name'
]
||=
"ldap
#{
key
}
"
.
downcase
server
[
'provider_name'
]
||=
"ldap
#{
key
}
"
.
downcase
...
...
config/initializers/7_omniauth.rb
View file @
c4d487a7
if
Gitlab
::
LDAP
::
Config
.
enabled?
if
Gitlab
::
LDAP
::
Config
.
enabled?
module
OmniAuth::Strategies
module
OmniAuth::Strategies
server
=
Gitlab
.
config
.
ldap
.
servers
.
values
.
first
server
=
Gitlab
.
config
.
ldap
.
servers
.
values
.
first
const_set
(
server
[
'provider_class'
],
Class
.
new
(
LDAP
))
klass
=
server
[
'provider_class'
]
const_set
(
klass
,
Class
.
new
(
LDAP
))
unless
klass
==
'LDAP'
end
end
OmniauthCallbacksController
.
class_eval
do
OmniauthCallbacksController
.
class_eval
do
...
...
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