diff options
author | seb <seb@seb-U36JC> | 2011-11-21 12:31:44 +0000 |
---|---|---|
committer | seb <seb@seb-U36JC> | 2011-11-21 12:31:44 +0000 |
commit | 5128b4348862037139df45da15d4eee314bc710a (patch) | |
tree | 27244482483e7217be247198024425a4d75c312d | |
parent | 892e5d6d7f51097f9d1c96bd8fd481b7513ec186 (diff) |
Username from users logged in as ADMIN_USERNAME should appear in administrative interface event logs. Fixes #287.
-rw-r--r-- | app/controllers/admin_controller.rb | 1 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 0bfbcd3d1..adb506b91 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -53,6 +53,7 @@ class AdminController < ApplicationController authenticate_or_request_with_http_basic do |user_name, password| if user_name == config_username && password == config_password session[:using_admin] = 1 + request.env['REMOTE_USER'] = user_name else request_http_basic_authentication end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ffe48c731..a486418ce 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -114,7 +114,7 @@ def validate_as_body(html) end def basic_auth_login(request, username = nil, password = nil) - username = MySociety::Config.get('ADMIN_USERNAME') if username.nil? + username = MySociety::Config.get('ADMIN_USERNAME') if username.nil? password = MySociety::Config.get('ADMIN_PASSWORD') if password.nil? request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("#{username}:#{password}") end |