X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/945d60ea5a52d0c1d41cc63456bd6f60e547e79e..a0b76fc2c5290534c90d8a16d50eb302424d8c21:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index cc4ae4cd8..2e80682a3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -46,7 +46,7 @@ class UserController < ApplicationController @title = t 'user.terms.title' @user = User.new(params[:user]) if params[:user] - if params[:user][:openid_url] and @user.pass_crypt.empty? + if params[:user] and params[:user][:openid_url] and @user.pass_crypt.empty? # We are creating an account with OpenID and no password # was specified so create a random one @user.pass_crypt = ActiveSupport::SecureRandom.base64(16) @@ -60,7 +60,7 @@ class UserController < ApplicationController elsif @user.terms_agreed? # Already agreed to terms, so just show settings redirect_to :action => :account, :display_name => @user.display_name - elsif params[:user][:openid_url] + elsif params[:user] and params[:user][:openid_url] # Verify OpenID before moving on session[:new_user] = @user openid_verify(params[:user][:openid_url], @user) @@ -231,7 +231,7 @@ class UserController < ApplicationController else password_authentication(params[:username], params[:password]) end - else + elsif flash[:notice].nil? flash.now[:notice] = t 'user.login.notice' end end