aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_controller.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-07-28 16:23:57 +0200
committerDavid Cabo <david@calibea.com>2011-07-28 16:23:57 +0200
commit3e60ff5a3e12ce29b00ce45056033267947229bb (patch)
tree6249246e8b52ddb3e836600401ee665eadc2e16e /app/controllers/admin_controller.rb
parent0fc9a9de34be417f23a2392535523c044f644db2 (diff)
parent51a74f4b275fab25ac567843ab99b885a8444789 (diff)
Merge branch 'master' of github.com:sebbacon/alaveteli into asktheeu
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r--app/controllers/admin_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 8598091d9..655670b5a 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -48,10 +48,13 @@ class AdminController < ApplicationController
def authenticate
username = MySociety::Config.get('ADMIN_USERNAME', '')
password = MySociety::Config.get('ADMIN_PASSWORD', '')
- if !(username && password).empty?
+ if !username.empty? && !password.empty?
authenticate_or_request_with_http_basic do |user_name, password|
user_name == username && password == password
+ session[:using_admin] = 1
end
+ else
+ session[:using_admin] = 1
end
end
end