]> source.dussan.org Git - redmine.git/commitdiff
Extract method
authorEric Davis <edavis@littlestreamsoftware.com>
Mon, 21 Dec 2009 02:24:44 +0000 (02:24 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Mon, 21 Dec 2009 02:24:44 +0000 (02:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3209 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/account_controller.rb

index c75f64e1b6fa2599482cc75bc0ee66772a2dd175..b1500d42832543419de44ab29fd15c93401f246e 100644 (file)
@@ -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