Created
May 16, 2014 16:24
-
-
Save kazuki/831432ad0634f2374030 to your computer and use it in GitHub Desktop.
redmine + httpd-auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb | |
index 43257b2..b946ec1 100644 | |
--- a/app/controllers/application_controller.rb | |
+++ b/app/controllers/application_controller.rb | |
@@ -108,6 +108,8 @@ class ApplicationController < ActionController::Base | |
if session[:user_id] | |
# existing session | |
user = (User.active.find(session[:user_id]) rescue nil) | |
+ elsif (forwarded_user = request.env["REMOTE_USER"]) | |
+ user = (User.find_by_login(forwarded_user) rescue nil) | |
elsif autologin_user = try_to_autologin | |
user = autologin_user | |
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment