diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 6 |
3 files changed, 15 insertions, 2 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 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 91754e2ba..d4c70ed1e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base helper_method :site_name, :locale_from_params def site_name # XXX should come from database: - site_name = "WhatDoTheyKnow" + site_name = "Informata Zyrtare" return site_name end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 6b1373e07..0c02effa7 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -404,6 +404,12 @@ class RequestController < ApplicationController redirect_to respond_to_last_url(@info_request) elsif @info_request.calculate_status == 'gone_postal' redirect_to respond_to_last_url(@info_request) + "?gone_postal=1" + elsif @info_request.calculate_status == 'deadline_extended' + flash[:notice] = "Authority has requested extension of the deadline." + redirect_to unhappy_url(@info_request) + elsif @info_request.calculate_status == 'wrong_response' + flash[:notice] = "Oh no! Sorry to hear that your request was wrong. Here is what to do now." + redirect_to unhappy_url(@info_request) elsif @info_request.calculate_status == 'internal_review' flash[:notice] = "<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within 20 days, or be told if it will take longer (<a href=\"" + unhappy_url(@info_request) + "#internal_review\">details</a>).</p>" redirect_to request_url(@info_request) |