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
af562851
Commit
af562851
authored
Nov 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.gitlab.org:gitlab/gitlab-ee
parents
abf60c4c
e3bf87d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
14 deletions
+18
-14
app/views/layouts/devise.html.haml
app/views/layouts/devise.html.haml
+2
-2
lib/api/internal.rb
lib/api/internal.rb
+7
-1
lib/gitlab/ldap/user.rb
lib/gitlab/ldap/user.rb
+9
-11
No files found.
app/views/layouts/devise.html.haml
View file @
af562851
...
@@ -13,5 +13,5 @@
...
@@ -13,5 +13,5 @@
#{
link_to
"Sign in"
,
new_user_session_path
}
or browse for
#{
link_to
"public projects"
,
public_projects_path
}
.
#{
link_to
"Sign in"
,
new_user_session_path
}
or browse for
#{
link_to
"public projects"
,
public_projects_path
}
.
%hr
%hr
=
yield
=
yield
%center
%center
.prepend-top-20
%h
5
.cwhite
Enterprise Edition
%h
6
Enterprise Edition
lib/api/internal.rb
View file @
af562851
...
@@ -35,7 +35,13 @@ module API
...
@@ -35,7 +35,13 @@ module API
user
=
key
.
user
user
=
key
.
user
return
false
if
user
.
blocked?
return
false
if
user
.
blocked?
return
false
if
user
.
ldap_user?
&&
Gitlab
::
LDAP
::
User
.
blocked?
(
user
.
extern_uid
)
if
user
.
ldap_user?
# Check if LDAP user exists and match LDAP user_filter
unless
Gitlab
::
LDAP
::
Access
.
allowed?
(
user
.
extern_uid
)
return
false
end
end
action
=
case
git_cmd
action
=
case
git_cmd
when
*
DOWNLOAD_COMMANDS
when
*
DOWNLOAD_COMMANDS
...
...
lib/gitlab/ldap/user.rb
View file @
af562851
...
@@ -62,8 +62,16 @@ module Gitlab
...
@@ -62,8 +62,16 @@ module Gitlab
return
nil
unless
ldap_conf
.
enabled
&&
login
.
present?
&&
password
.
present?
return
nil
unless
ldap_conf
.
enabled
&&
login
.
present?
&&
password
.
present?
ldap
=
OmniAuth
::
LDAP
::
Adaptor
.
new
(
ldap_conf
)
ldap
=
OmniAuth
::
LDAP
::
Adaptor
.
new
(
ldap_conf
)
filter
=
Net
::
LDAP
::
Filter
.
eq
(
ldap
.
uid
,
login
)
# Apply LDAP user filter if present
if
ldap_conf
[
'user_filter'
].
present?
user_filter
=
Net
::
LDAP
::
Filter
.
construct
(
ldap_conf
[
'user_filter'
])
filter
=
Net
::
LDAP
::
Filter
.
join
(
filter
,
user_filter
)
end
ldap_user
=
ldap
.
bind_as
(
ldap_user
=
ldap
.
bind_as
(
filter:
Net
::
LDAP
::
Filter
.
eq
(
ldap
.
uid
,
login
)
,
filter:
filter
,
size:
1
,
size:
1
,
password:
password
password:
password
)
)
...
@@ -71,16 +79,6 @@ module Gitlab
...
@@ -71,16 +79,6 @@ module Gitlab
find_by_uid
(
ldap_user
.
dn
)
if
ldap_user
find_by_uid
(
ldap_user
.
dn
)
if
ldap_user
end
end
# Check LDAP user existance by dn. User in git over ssh check
#
# It covers 2 cases:
# * when ldap account was removed
# * when ldap account was deactivated by change of OU membership in 'dn'
def
blocked?
(
dn
)
ldap
=
OmniAuth
::
LDAP
::
Adaptor
.
new
(
ldap_conf
)
ldap
.
connection
.
search
(
base:
dn
,
size:
1
).
blank?
end
private
private
def
find_by_uid
(
uid
)
def
find_by_uid
(
uid
)
...
...
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