diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-07-06 10:35:56 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-07-06 10:35:56 +0100 |
commit | fb183ab07052293acabde9fa249f5d1952d56465 (patch) | |
tree | 41667f77795a108b77be73e9de9824d9b4fab8da /app/controllers/admin_controller.rb | |
parent | 4d36238dbc2a239b48193b9089c3321a3103346f (diff) | |
parent | e7cd3adc2775b1450251f89d70680b3be8f291a3 (diff) |
initial merge of Kosovan branch; still need to get tests passing, factor out Kosovan-specific code
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 004d460c5..75658f6de 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -10,7 +10,8 @@ require 'fileutils' class AdminController < ApplicationController layout "admin" - before_filter :assign_http_auth_user + before_filter :authenticate + USER_NAME, PASSWORD = "sadminiz", "w5x^H^<{J231s3" protect_from_forgery # See ActionController::RequestForgeryProtection for details # action to take if expecting an authenticity token and one isn't received @@ -44,5 +45,11 @@ class AdminController < ApplicationController expire_for_request(info_request) end end + private + def authenticate + authenticate_or_request_with_http_basic do |user_name, password| + user_name == USER_NAME && password == PASSWORD + end + end end |