From: Jean-Philippe Lang Date: Sat, 27 May 2017 07:34:35 +0000 (+0000) Subject: Merged r16554 and r16555 (#25653). X-Git-Tag: 3.3.4~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=996cb52bee963da51ee3d3078c7a01a8797e4cb5;p=redmine.git Merged r16554 and r16555 (#25653). git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16562 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 1a2e5b6b2..98ca2f5f5 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -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