]> source.dussan.org Git - redmine.git/commitdiff
Merged r16554 and r16555 (#25653).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 27 May 2017 07:34:35 +0000 (07:34 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 27 May 2017 07:34:35 +0000 (07:34 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16562 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/account_controller.rb

index 1a2e5b6b21d7c0e2e38c16b6cd46c1747522b11e..98ca2f5f5fa53b6c10393312a9161dad2b653538 100644 (file)
@@ -32,12 +32,12 @@ class AccountController < ApplicationController
 
   # Login request and validation
   def login
-    if request.get?
+    if request.post?
+      authenticate_user
+    else
       if User.current.logged?
         redirect_back_or_default home_url, :referer => true
       end
-    else
-      authenticate_user
     end
   rescue AuthSourceException => e
     logger.error "An error occured when authenticating #{params[:username]}: #{e.message}"
@@ -124,7 +124,7 @@ class AccountController < ApplicationController
   # User self-registration
   def register
     (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration]
-    if request.get?
+    if !request.post?
       session[:auth_source_registration] = nil
       @user = User.new(:language => current_language.to_s)
     else