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
0ebe09e4
Commit
0ebe09e4
authored
Oct 16, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only initialize if ldap is enabled
parent
18d87dcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
config/initializers/7_omniauth.rb
config/initializers/7_omniauth.rb
+12
-10
config/initializers/devise.rb
config/initializers/devise.rb
+1
-1
No files found.
config/initializers/7_omniauth.rb
View file @
0ebe09e4
module
OmniAuth::Strategies
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
# do not redeclare LDAP
next
if
server
[
'provider_name'
]
==
'ldap'
const_set
(
server
[
'provider_class'
],
Class
.
new
(
LDAP
))
if
Gitlab
::
LDAP
::
Config
.
enabled?
module
OmniAuth::Strategies
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
# do not redeclare LDAP
next
if
server
[
'provider_name'
]
==
'ldap'
const_set
(
server
[
'provider_class'
],
Class
.
new
(
LDAP
))
end
end
end
OmniauthCallbacksController
.
class_eval
do
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
alias_method
server
[
'provider_name'
],
:ldap
OmniauthCallbacksController
.
class_eval
do
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
alias_method
server
[
'provider_name'
],
:ldap
end
end
end
end
\ No newline at end of file
config/initializers/devise.rb
View file @
0ebe09e4
...
...
@@ -204,7 +204,7 @@ Devise.setup do |config|
# manager.default_strategies(scope: :user).unshift :some_external_strategy
# end
if
Gitlab
.
config
.
ldap
.
enabled
if
Gitlab
::
LDAP
::
Config
.
enabled?
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
if
server
[
'allow_username_or_email_login'
]
email_stripping_proc
=
->
(
name
)
{
name
.
gsub
(
/@.*$/
,
''
)}
...
...
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