BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7edbee6c
Commit
7edbee6c
authored
Jun 11, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'strip_apostrophe_from_email_generated_username' into 'master'
Strip apostrophe from email generated username Related to #1225 Fixes #1225
parents
4b6c93c1
314e4736
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
user.rb
lib/gitlab/ldap/user.rb
+3
-1
user.rb
lib/gitlab/oauth/user.rb
+3
-1
No files found.
lib/gitlab/ldap/user.rb
View file @
7edbee6c
...
...
@@ -50,7 +50,9 @@ module Gitlab
# we look for user by extracting part of their email
if
!
user
&&
email
&&
ldap_conf
[
'allow_username_or_email_login'
]
uname
=
email
.
partition
(
'@'
).
first
user
=
model
.
find_by
(
username:
uname
)
# Strip apostrophes since they are disallowed as part of username
username
=
uname
.
gsub
(
"'"
,
""
)
user
=
model
.
find_by
(
username:
username
)
end
user
...
...
lib/gitlab/oauth/user.rb
View file @
7edbee6c
...
...
@@ -39,7 +39,9 @@ module Gitlab
# So we use part of email as username for new user
# For LDAP, username is already set to the user's
# uid/userid/sAMAccountName.
user
.
username
=
email
.
match
(
/^[^@]*/
)[
0
]
email_username
=
email
.
match
(
/^[^@]*/
)[
0
]
# Strip apostrophes since they are disallowed as part of username
user
.
username
=
email_username
.
gsub
(
"'"
,
""
)
end
user
.
save!
...
...
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