diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-12-21 02:24:44 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-12-21 02:24:44 +0000 |
commit | c478fa7f907ea8a0df118dfedfc26f4c1a6d886d (patch) | |
tree | 3b3a4ce266684fe38c4ba1bee08a9fc5948cc79c /app | |
parent | 0844a22b02a97f5c9003e2462d169f1e06739b37 (diff) | |
download | redmine-c478fa7f907ea8a0df118dfedfc26f4c1a6d886d.tar.gz redmine-c478fa7f907ea8a0df118dfedfc26f4c1a6d886d.zip |
Extract method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3209 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/account_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index c75f64e1b..b1500d428 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -137,9 +137,9 @@ class AccountController < ApplicationController def password_authentication user = User.try_to_login(params[:username], params[:password]) + if user.nil? - # Invalid credentials - flash.now[:error] = l(:notice_account_invalid_creditentials) + invalid_credentials elsif user.new_record? onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id }) else @@ -209,6 +209,10 @@ class AccountController < ApplicationController render :action => 'register' end + def invalid_credentials + flash.now[:error] = l(:notice_account_invalid_creditentials) + end + # Register a user for email activation. # # Pass a block for behavior when a user fails to save |