@@ -177,21 +177,21 class AccountController < ApplicationController | |||||
177 |
|
177 | |||
178 | def open_id_authenticate(openid_url) |
|
178 | def open_id_authenticate(openid_url) | |
179 | back_url = signin_url(:autologin => params[:autologin]) |
|
179 | back_url = signin_url(:autologin => params[:autologin]) | |
180 |
|
180 | authenticate_with_open_id( | ||
181 | authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => back_url, :method => :post) do |result, identity_url, registration| |
|
181 | openid_url, :required => [:nickname, :fullname, :email], | |
|
182 | :return_to => back_url, :method => :post | |||
|
183 | ) do |result, identity_url, registration| | |||
182 | if result.successful? |
|
184 | if result.successful? | |
183 | user = User.find_or_initialize_by_identity_url(identity_url) |
|
185 | user = User.find_or_initialize_by_identity_url(identity_url) | |
184 | if user.new_record? |
|
186 | if user.new_record? | |
185 | # Self-registration off |
|
187 | # Self-registration off | |
186 | (redirect_to(home_url); return) unless Setting.self_registration? |
|
188 | (redirect_to(home_url); return) unless Setting.self_registration? | |
187 |
|
||||
188 | # Create on the fly |
|
189 | # Create on the fly | |
189 | user.login = registration['nickname'] unless registration['nickname'].nil? |
|
190 | user.login = registration['nickname'] unless registration['nickname'].nil? | |
190 | user.mail = registration['email'] unless registration['email'].nil? |
|
191 | user.mail = registration['email'] unless registration['email'].nil? | |
191 | user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil? |
|
192 | user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil? | |
192 | user.random_password |
|
193 | user.random_password | |
193 | user.register |
|
194 | user.register | |
194 |
|
||||
195 | case Setting.self_registration |
|
195 | case Setting.self_registration | |
196 | when '1' |
|
196 | when '1' | |
197 | register_by_email_activation(user) do |
|
197 | register_by_email_activation(user) do |
General Comments 0
You need to be logged in to leave comments.
Login now