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