Project

General

Profile

« Previous | Next » 

Revision 8ffa0b9a

Added by Jan Pazdziora over 10 years ago

fixes #3528 - Populate first name, last name, and email, if available.

View differences:

app/models/user.rb
end
end
def self.find_or_create_external_user(login, auth_source_name)
if (user = unscoped.find_by_login(login))
user.post_successful_login
def self.find_or_create_external_user(attrs, auth_source_name)
if (user = unscoped.find_by_login(attrs[:login]))
return true
elsif auth_source_name.nil?
return false
......
User.as :admin do
options = { :name => auth_source_name }
auth_source = AuthSource.where(options).first || AuthSourceExternal.create!(options)
user = User.create!(:login => login, :auth_source => auth_source)
user = User.create!(attrs.merge(:auth_source => auth_source))
user.post_successful_login
end
return true

Also available in: Unified diff