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
8a8123a3
Commit
8a8123a3
authored
Sep 22, 2013
by
Izaak Alpert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for readability
fixed a test a broke in the configurable theme PR Change-Id: Id894506941bc01ab0d259d48ca7ff9b80bb2c57e
parent
75b2ff8f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
user.rb
lib/gitlab/ldap/user.rb
+7
-3
user_spec.rb
spec/models/user_spec.rb
+1
-1
No files found.
lib/gitlab/ldap/user.rb
View file @
8a8123a3
...
...
@@ -44,11 +44,15 @@ module Gitlab
end
def
find_user
(
email
)
if
user
=
model
.
find_by_email
(
email
)
elsif
ldap_conf
[
'allow_username_or_email_login'
]
uname
=
(
email
.
partition
(
'@'
).
first
)
unless
email
.
nil?
user
=
model
.
find_by_email
(
email
)
# If no user found and allow_username_or_email_login is true
# we look for user by extracting part of his email
if
!
user
&&
email
&&
ldap_conf
[
'allow_username_or_email_login'
]
uname
=
email
.
partition
(
'@'
).
first
user
=
model
.
find_by_username
(
uname
)
end
user
end
...
...
spec/models/user_spec.rb
View file @
8a8123a3
...
...
@@ -233,7 +233,7 @@ describe User do
it
"should apply defaults to user"
do
Gitlab
.
config
.
gitlab
.
default_projects_limit
.
should_not
==
123
Gitlab
.
config
.
gitlab
.
default_can_create_group
.
should_not
be_true
Gitlab
.
config
.
gitlab
.
default_theme
.
should_not
==
Gitlab
::
Theme
::
MARS
Gitlab
.
config
.
gitlab
.
default_theme
.
should_not
==
Gitlab
::
Theme
::
BASIC
user
.
projects_limit
.
should
==
123
user
.
can_create_group
.
should
be_true
user
.
theme_id
.
should
==
Gitlab
::
Theme
::
BASIC
...
...
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