Cleaned up the sso codefix, thanks @SamSaffron

@SamSaffron showed me a cleaner way to use the if statements in the sso redirect code.

Thanks sam ;)
This commit is contained in:
Sigurður Guðbrandsson 2015-02-23 22:10:44 +00:00
parent 334a357363
commit 96e6fd3449

View file

@ -391,10 +391,12 @@ class ApplicationController < ActionController::Base
cookies[:destination_url] = request.original_url unless request.original_url =~ /uploads/
# redirect user to the SSO page if we need to log in AND SSO is enabled
if (SiteSetting.enable_sso && SiteSetting.login_required)
redirect_to '/session/sso'
elsif SiteSetting.login_required?
redirect_to :login
if SiteSetting.login_required?
if SiteSetting.enable_sso?
redirect_to '/session/sso'
else
redirect_to :login
end
end
end