diff options
author | Faton Selishta <fatonselishta@gmail.com> | 2011-06-02 14:32:00 +0000 |
---|---|---|
committer | Faton Selishta <fatonselishta@gmail.com> | 2011-06-02 14:32:00 +0000 |
commit | 018e04dd94503dec29fe13c8f1044a0fda887698 (patch) | |
tree | d22c31839ab6430e45b44abc48ac2dcb6f151328 /app/controllers/admin_controller.rb | |
parent | 03288683a6b4f95b5f3a007433b4adf8c5f22c17 (diff) |
Specific code for our requirements (kosovo law, our request etc..)
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 |