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
4210d0f5
Commit
4210d0f5
authored
Apr 06, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip email confirmation when updated via LDAP.
parent
20bc37ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
14 deletions
+12
-14
CHANGELOG-EE
CHANGELOG-EE
+1
-0
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+7
-10
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+4
-4
No files found.
CHANGELOG-EE
View file @
4210d0f5
v 7.10.0 (unreleased)
- Improve UI for next pages: Group LDAP sync, Project git hooks, Project share with groups, Admin -> Appearance settigns
- Default git hooks for new projects
- Skip email confirmation when updated via LDAP.
v 7.9.0 (unreleased)
- Strip prefixes and suffixes from synced SSH keys:
...
...
lib/gitlab/ldap/access.rb
View file @
4210d0f5
...
...
@@ -103,17 +103,14 @@ module Gitlab
# Update user email if it changed in LDAP
def
update_email
if
ldap_user
.
try
(
:email
)
ldap_email
=
ldap_user
.
email
.
last
.
to_s
.
downcase
return
false
unless
ldap_user
.
try
(
:email
)
if
(
user
.
email
!=
ldap_email
)
user
.
update
(
email:
ldap_email
)
else
false
end
else
false
end
ldap_email
=
ldap_user
.
email
.
last
.
to_s
.
downcase
return
false
if
user
.
email
==
ldap_email
user
.
skip_reconfirmation!
user
.
update
(
email:
ldap_email
)
end
def
update_admin_status
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
4210d0f5
...
...
@@ -145,22 +145,22 @@ describe Gitlab::LDAP::Access do
end
it
"should not update email if email attribute is not set"
do
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:
unconfirmed_
email
)
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:email
)
end
it
"should not update the email if the user has the same email in GitLab and in LDAP"
do
entry
[
'mail'
]
=
[
user
.
email
]
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:
unconfirmed_
email
)
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:email
)
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
[
'mail'
]
=
[
user
.
email
.
upcase
]
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:
unconfirmed_
email
)
expect
{
access
.
update_email
}.
to_not
change
(
user
,
:email
)
end
it
"should update the email if the user email is different"
do
entry
[
'mail'
]
=
[
"new_email@example.com"
]
expect
{
access
.
update_email
}.
to
change
(
user
,
:
unconfirmed_
email
)
expect
{
access
.
update_email
}.
to
change
(
user
,
:email
)
end
end
...
...
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