openid_account_controller_patch.rb.patch
| lib/openid_account_controller_patch.rb.new 2012-04-18 11:03:12.081288885 +0100 | ||
|---|---|---|
| 72 | 72 | |
| 73 | 73 |
authenticate_with_open_id(openid_url, :required => options, :return_to => signin_url) do |result, identity_url, registration| |
| 74 | 74 |
if result.successful? |
| 75 |
user = User.find_or_initialize_by_identity_url(identity_url) |
|
| 75 |
user = User.find_or_initialize_by_identity_url(identity_url) |
|
| 76 |
if user.new_record? and registration[OPENID_AX_EMAIL] |
|
| 77 |
userByEmail = User.find_by_mail(registration[OPENID_AX_EMAIL].first) |
|
| 78 |
if userByEmail |
|
| 79 |
user = userByEmail |
|
| 80 |
user.identity_url = identity_url |
|
| 81 |
user.save() |
|
| 82 |
end |
|
| 83 |
end |
|
| 84 | ||
| 76 | 85 |
if user.new_record? |
| 77 | 86 |
redirect_to(home_url) && return unless Setting.self_registration? |