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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ad265b96
Commit
ad265b96
authored
Aug 05, 2012
by
Jakub Jirutka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding workaround for backward compatibility with legacy LDAP users
parent
fa5a53f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
app/models/user.rb
app/models/user.rb
+6
-1
No files found.
app/models/user.rb
View file @
ad265b96
...
...
@@ -95,8 +95,13 @@ class User < ActiveRecord::Base
if
@user
=
User
.
find_by_extern_uid_and_provider
(
uid
,
provider
)
@user
# workaround for backward compatibility
elsif
@user
=
User
.
find_by_email
(
email
)
logger
.
info
"Updating legacy LDAP user
#{
email
}
with extern_uid =>
#{
uid
}
"
@user
.
update_attributes
(
:extern_uid
=>
uid
,
:provider
=>
provider
)
@user
else
logger
.
info
"Creating user from LDAP login
; uid =
#{
uid
}
, name =
#{
name
}
, email =
#{
email
}
"
logger
.
info
"Creating user from LDAP login
{uid =>
#{
uid
}
, name =>
#{
name
}
, email =>
#{
email
}
}"
password
=
Devise
.
friendly_token
[
0
,
8
].
downcase
@user
=
User
.
create
(
:extern_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