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
7ab46831
Commit
7ab46831
authored
May 22, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ldap_email_downcase' into 'master'
Fix LDAP email upper case bug
parents
95ef8f97
cd3fb5ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
CHANGELOG-EE
CHANGELOG-EE
+1
-0
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
spec/lib/gitlab/ldap/ldap_access_spec.rb
spec/lib/gitlab/ldap/ldap_access_spec.rb
+8
-0
No files found.
CHANGELOG-EE
View file @
7ab46831
...
...
@@ -2,6 +2,7 @@ v 6.9.0
- Add support for closing Jira tickets with commits and MR
- Template for Merge Request description can be added in project settings
- Jenkins CI service
- Fix LDAP email upper case bug
v 6.8.0
- Customise sign-in page with custom text and logo
...
...
lib/gitlab/ldap/access.rb
View file @
7ab46831
...
...
@@ -63,7 +63,7 @@ module Gitlab
gitlab_user
=
::
User
.
where
(
provider:
'ldap'
,
extern_uid:
uid
).
last
if
gitlab_user
&&
ldap_user
&&
ldap_user
.
email
ldap_email
=
ldap_user
.
email
.
last
ldap_email
=
ldap_user
.
email
.
last
.
to_s
.
downcase
if
(
gitlab_user
.
email
!=
ldap_email
)
gitlab_user
.
update
(
email:
ldap_email
)
...
...
spec/lib/gitlab/ldap/ldap_access_spec.rb
View file @
7ab46831
...
...
@@ -50,6 +50,14 @@ describe Gitlab::LDAP::Access do
updated
.
should
==
false
end
it
"should not update the email if the user has the same email GitLab and in LDAP, but with upper case in LDAP"
do
entry
=
Net
::
LDAP
::
Entry
.
new
entry
[
'mail'
]
=
[
user_ldap
.
email
.
upcase
]
Gitlab
::
LDAP
::
Adapter
.
any_instance
.
stub
(
:user
)
{
Gitlab
::
LDAP
::
Person
.
new
(
entry
)
}
updated
=
access
.
update_email
(
user_ldap
)
updated
.
should
==
false
end
it
"should update the email if the user email is different"
do
entry
=
Net
::
LDAP
::
Entry
.
new
entry
[
'mail'
]
=
[
"new_email@example.com"
]
...
...
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