Skip to content
Snippets Groups Projects
Commit ad265b96 authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

Adding workaround for backward compatibility with legacy LDAP users

parent fa5a53f5
No related branches found
No related tags found
1 merge request!1164Fixed identification of users with extern auth provider (LDAP)
Loading
Loading
@@ -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,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment