From f341b0388cceef1a02ea56b5b1ca0d744c52c4b7 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Thu, 6 May 2010 17:34:24 +0100 Subject: Read only mode. --- app/controllers/application_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1addc5bab..0e01ac149 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -175,6 +175,16 @@ class ApplicationController < ActionController::Base end end + # + def check_read_only + read_only = MySociety::Config.get('READ_ONLY') + if read_only + flash[:notice] = "

WhatDoTheyKnow is currently in maintenance. You can only view existing requests. You cannot make new ones, add followups or annotations, or otherwise change the database.

" + read_only + "

" + redirect_to frontpage_url + end + + end + # For administration interface, return display name of authenticated user def admin_http_auth_user # This needs special magic in mongrel: http://www.ruby-forum.com/topic/83067 -- cgit v1.2.3