Feature #1300 » 0001-Fixes-1300-with-REMOTE_USER-support.patch
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
|
||
logger.warn("Failed authentcation from REMOTE_USER") if User.current.nil?
|
||
session[:user] = User.current.id
|
||
return !User.current.nil?
|
||
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
|