diff options
author | Francis Irving <francis@mysociety.org> | 2010-05-06 17:34:24 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-05-06 17:34:24 +0100 |
commit | f341b0388cceef1a02ea56b5b1ca0d744c52c4b7 (patch) | |
tree | b0fb5f256a7b429fbebe7b76ec604eb8efcb1686 /app/controllers/application_controller.rb | |
parent | d59f746428791971b023d711aa58b5e4cd9a11b5 (diff) |
Read only mode.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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] = "<p>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.</p> <p>" + read_only + "</p>" + 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 |