Project

General

Profile

Feature #1300 » 0001-fixes-1300-with-REMOTE_USER-support.patch

Romain Vrignaud, 11/15/2011 12:00 PM

View differences:

app/controllers/application_controller.rb
logger.warn("Failed authentcation from #{request.remote_ip} #{user}") if User.current.nil?
return !User.current.nil?
end
# if login delegation authorized and REMOTE_USER not empty, authenticate user without using password
if SETTINGS[:authorize_login_delegation] == true and !request.env["REMOTE_USER"].nil?
user = User.find_by_login(request.env["REMOTE_USER"])
User.current = user.is_a?(User) ? user : nil
if !user.nil?
session[:user] = User.current.id
return !User.current.nil?
else
logger.warn("Failed authentcation from REMOTE_USER") if User.current.nil?
end
end
session[:original_uri] = request.request_uri # keep the old request uri that we can redirect later on
redirect_to login_users_path and return
else
(2-2/4)