aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_controller.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-09-25 08:55:35 +1000
committerMatthew Landauer <matthew@openaustralia.org>2012-09-25 08:55:35 +1000
commitf59700138f7360436767fddea554c739e2cd484b (patch)
tree8c3af52f3f1f369ab412fa7571f19860e4f260b8 /app/controllers/admin_controller.rb
parent265e336ae0608af39aa3aad8b27862e572222562 (diff)
Extract configuration with defaults into one module
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r--app/controllers/admin_controller.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 08528f8a8..b0c936a62 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -48,7 +48,7 @@ class AdminController < ApplicationController
end
def authenticate
- if MySociety::Config.get('SKIP_ADMIN_AUTH', false)
+ if Configuration::skip_admin_auth
session[:using_admin] = 1
return
else
@@ -70,10 +70,8 @@ class AdminController < ApplicationController
end
end
else
- config_username = MySociety::Config.get('ADMIN_USERNAME', '')
- config_password = MySociety::Config.get('ADMIN_PASSWORD', '')
authenticate_or_request_with_http_basic do |user_name, password|
- if user_name == config_username && password == config_password
+ if user_name == Configuration::admin_username && password == Configuration::admin_password
session[:using_admin] = 1
request.env['REMOTE_USER'] = user_name
else