aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_censor_rule_controller.rb2
-rw-r--r--app/controllers/admin_controller.rb8
-rw-r--r--app/controllers/admin_general_controller.rb2
-rw-r--r--app/controllers/admin_public_body_controller.rb2
-rw-r--r--app/controllers/admin_request_controller.rb8
-rw-r--r--app/controllers/admin_track_controller.rb2
-rw-r--r--app/controllers/admin_user_controller.rb2
-rw-r--r--app/controllers/api_controller.rb2
-rw-r--r--app/controllers/application_controller.rb19
-rw-r--r--app/controllers/comment_controller.rb2
-rw-r--r--app/controllers/general_controller.rb14
-rw-r--r--app/controllers/help_controller.rb4
-rw-r--r--app/controllers/holiday_controller.rb4
-rw-r--r--app/controllers/public_body_controller.rb2
-rw-r--r--app/controllers/request_controller.rb17
-rw-r--r--app/controllers/request_game_controller.rb2
-rw-r--r--app/controllers/services_controller.rb6
-rw-r--r--app/controllers/track_controller.rb2
-rw-r--r--app/controllers/user_controller.rb6
19 files changed, 34 insertions, 72 deletions
diff --git a/app/controllers/admin_censor_rule_controller.rb b/app/controllers/admin_censor_rule_controller.rb
index 52df8dfc1..dca312b8b 100644
--- a/app/controllers/admin_censor_rule_controller.rb
+++ b/app/controllers/admin_censor_rule_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_censor_rule_controller.rb,v 1.7 2009-06-30 14:28:25 francis Exp $
class AdminCensorRuleController < AdminController
def new
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 08528f8a8..dd966c4af 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_controller.rb,v 1.29 2009-09-17 10:24:35 francis Exp $
require 'fileutils'
@@ -48,7 +46,7 @@ class AdminController < ApplicationController
end
def authenticate
- if MySociety::Config.get('SKIP_ADMIN_AUTH', false)
+ if Configuration::skip_admin_auth
session[:using_admin] = 1
return
else
@@ -70,10 +68,8 @@ class AdminController < ApplicationController
end
end
else
- config_username = MySociety::Config.get('ADMIN_USERNAME', '')
- config_password = MySociety::Config.get('ADMIN_PASSWORD', '')
authenticate_or_request_with_http_basic do |user_name, password|
- if user_name == config_username && password == config_password
+ if user_name == Configuration::admin_username && password == Configuration::admin_password
session[:using_admin] = 1
request.env['REMOTE_USER'] = user_name
else
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index 7e8498d8a..5176eb8db 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_general_controller.rb,v 1.12 2009-10-03 01:28:33 francis Exp $
class AdminGeneralController < AdminController
def index
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index 30a43bb81..e64925bde 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_public_body_controller.rb,v 1.23 2009-08-26 00:58:29 francis Exp $
require "public_body_categories"
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index 53ff2957b..c97ef7f1e 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_request_controller.rb,v 1.42 2009-10-03 01:28:33 francis Exp $
require 'ostruct'
@@ -42,9 +40,9 @@ class AdminRequestController < AdminController
# XXX is this *really* the only way to render a template to a
# variable, rather than to the response?
vars = OpenStruct.new(:name_to => @info_request.user_name,
- :name_from => MySociety::Config.get("CONTACT_NAME", 'Alaveteli'),
+ :name_from => Configuration::contact_name,
:info_request => @info_request, :reason => params[:reason],
- :info_request_url => 'http://' + MySociety::Config.get('DOMAIN') + request_url(@info_request),
+ :info_request_url => 'http://' + Configuration::domain + request_url(@info_request),
:site_name => site_name)
template = File.read(File.join(File.dirname(__FILE__), "..", "views", "admin_request", "hidden_user_explanation.rhtml"))
@request_hidden_user_explanation = ERB.new(template).result(vars.instance_eval { binding })
@@ -95,7 +93,7 @@ class AdminRequestController < AdminController
:old_allow_new_responses_from => old_allow_new_responses_from, :allow_new_responses_from => @info_request.allow_new_responses_from,
:old_handle_rejected_responses => old_handle_rejected_responses, :handle_rejected_responses => @info_request.handle_rejected_responses,
:old_tag_string => old_tag_string, :tag_string => @info_request.tag_string,
- :old_comments_allowed => old_comments_allowed, :tag_string => @info_request.comments_allowed
+ :old_comments_allowed => old_comments_allowed, :comments_allowed => @info_request.comments_allowed
})
# expire cached files
expire_for_request(@info_request)
diff --git a/app/controllers/admin_track_controller.rb b/app/controllers/admin_track_controller.rb
index 7142dc18e..03217da45 100644
--- a/app/controllers/admin_track_controller.rb
+++ b/app/controllers/admin_track_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_track_controller.rb,v 1.5 2009-01-29 12:10:10 francis Exp $
class AdminTrackController < AdminController
def list
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb
index 4059ac0bb..ed20ddcf4 100644
--- a/app/controllers/admin_user_controller.rb
+++ b/app/controllers/admin_user_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: admin_user_controller.rb,v 1.13 2009-07-28 12:53:54 francis Exp $
class AdminUserController < AdminController
def index
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 409a432eb..aa5e85db3 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -248,6 +248,6 @@ class ApiController < ApplicationController
private
def make_url(*args)
- "http://" + MySociety::Config.get("DOMAIN", '127.0.0.1:3000') + "/" + args.join("/")
+ "http://" + Configuration::domain + "/" + args.join("/")
end
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ce18e6ef5..f29015c63 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -6,8 +6,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: application.rb,v 1.59 2009-09-17 13:01:56 francis Exp $
require 'open-uri'
@@ -56,7 +54,7 @@ class ApplicationController < ActionController::Base
end
def set_gettext_locale
- if MySociety::Config.get('USE_DEFAULT_BROWSER_LANGUAGE', true)
+ if Configuration::use_default_browser_language
requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale
else
requested_locale = params[:locale] || session[:locale] || cookies[:locale] || I18n.default_locale
@@ -89,7 +87,7 @@ class ApplicationController < ActionController::Base
# egrep "CONSUME MEMORY: [0-9]{7} KB" production.log
around_filter :record_memory
def record_memory
- record_memory = MySociety::Config.get('DEBUG_RECORD_MEMORY', false)
+ record_memory = Configuration::debug_record_memory
if record_memory
logger.info "Processing request for #{request.url} with Rails process #{Process.pid}"
File.read("/proc/#{Process.pid}/status").match(/VmRSS:\s+(\d+)/)
@@ -333,11 +331,10 @@ class ApplicationController < ActionController::Base
#
def check_read_only
- read_only = MySociety::Config.get('READ_ONLY', '')
- if !read_only.empty?
+ if !Configuration::read_only.empty?
flash[:notice] = _("<p>{{site_name}} 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>",
:site_name => site_name,
- :read_only => read_only)
+ :read_only => Configuration::read_only)
redirect_to frontpage_url
end
@@ -557,13 +554,11 @@ class ApplicationController < ActionController::Base
end
def country_from_ip
- gaze = MySociety::Config.get('GAZE_URL', '')
- default = MySociety::Config.get('ISO_COUNTRY_CODE', '')
country = ""
- if !gaze.empty?
- country = quietly_try_to_open("#{gaze}/gaze-rest?f=get_country_from_ip;ip=#{request.remote_ip}")
+ if !Configuration::gaze_url.empty?
+ country = quietly_try_to_open("#{Configuration::gaze_url}/gaze-rest?f=get_country_from_ip;ip=#{request.remote_ip}")
end
- country = default if country.empty?
+ country = Configuration::iso_country_code if country.empty?
return country
end
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index 988a8a6f8..ed249d6cc 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: comment_controller.rb,v 1.9 2009-03-09 01:17:04 francis Exp $
class CommentController < ApplicationController
before_filter :check_read_only, :only => [ :new ]
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 839064fcd..150b433ec 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -4,8 +4,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: general_controller.rb,v 1.57 2009-10-03 10:23:43 francis Exp $
begin
require 'xmlsimple'
@@ -24,7 +22,7 @@ class GeneralController < ApplicationController
behavior_cache :tag => [session[:user_id], request.url] do
# get some example searches and public bodies to display
# either from config, or based on a (slow!) query if not set
- body_short_names = MySociety::Config.get('FRONTPAGE_PUBLICBODY_EXAMPLES', '').split(/\s*;\s*/).map{|s| "'%s'" % s.gsub(/'/, "''") }.join(", ")
+ body_short_names = Configuration::frontpage_publicbody_examples.split(/\s*;\s*/).map{|s| "'%s'" % s.gsub(/'/, "''") }.join(", ")
@locale = self.locale_from_params()
locale_condition = 'public_body_translations.locale = ?'
conditions = [locale_condition, @locale]
@@ -32,8 +30,7 @@ class GeneralController < ApplicationController
if body_short_names.empty?
# This is too slow
@popular_bodies = PublicBody.find(:all,
- :select => "public_bodies.*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c",
- :order => "c desc",
+ :order => "info_requests_count desc",
:limit => 32,
:conditions => conditions,
:joins => :translations
@@ -56,10 +53,13 @@ class GeneralController < ApplicationController
# If there are not yet enough successful requests, fill out the list with
# other requests
if @request_events.count < max_count
+ @request_events_all_successful = false
query = 'variety:sent'
xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count-@request_events.count)
more_events = xapian_object.results.map { |r| r[:model] }
@request_events += more_events
+ else
+ @request_events_all_successful = true
end
rescue
@request_events = []
@@ -71,7 +71,7 @@ class GeneralController < ApplicationController
def blog
medium_cache
@feed_autodetect = []
- @feed_url = "#{MySociety::Config.get('BLOG_FEED', '')}?lang=#{self.locale_from_params()}"
+ @feed_url = "#{Configuration::blog_feed}?lang=#{self.locale_from_params()}"
@blog_items = []
if not @feed_url.empty?
content = quietly_try_to_open(@feed_url)
@@ -82,7 +82,7 @@ class GeneralController < ApplicationController
@feed_autodetect = [{:url => @feed_url, :title => "#{site_name} blog"}]
end
end
- @twitter_user = MySociety::Config.get('TWITTER_USERNAME', '')
+ @twitter_user = Configuration::twitter_username
end
# Just does a redirect from ?query= search to /query
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index c7affd57c..cf90f45bb 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: help_controller.rb,v 1.12 2009-07-14 23:30:37 francis Exp $
class HelpController < ApplicationController
@@ -20,7 +18,7 @@ class HelpController < ApplicationController
end
def contact
- @contact_email = MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost')
+ @contact_email = Configuration::contact_email
@contact_email = @contact_email.gsub(/@/, "&#64;")
# if they clicked remove for link to request/body, remove it
diff --git a/app/controllers/holiday_controller.rb b/app/controllers/holiday_controller.rb
index 7f62aa26d..3101c07e3 100644
--- a/app/controllers/holiday_controller.rb
+++ b/app/controllers/holiday_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: holiday_controller.rb,v 1.2 2009-10-26 17:52:39 francis Exp $
class HolidayController < ApplicationController
@@ -14,7 +12,7 @@ class HolidayController < ApplicationController
def due_date
if params[:holiday]
@request_date = Date.strptime(params[:holiday]) or raise "Invalid date"
- @due_date = Holiday.due_date_from(@request_date, 20)
+ @due_date = Holiday.due_date_from(@request_date, Configuration::reply_late_after_days, Configuration::working_or_calendar_days)
@skipped = Holiday.all(
:conditions => [ 'day >= ? AND day <= ?',
@request_date.strftime("%F"), @due_date.strftime("%F")
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index b8ea82a66..b34e89b8d 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -4,8 +4,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: public_body_controller.rb,v 1.8 2009-09-14 13:27:00 francis Exp $
require 'fastercsv'
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 268ecc73a..396e6593a 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: request_controller.rb,v 1.192 2009-10-19 19:26:40 francis Exp $
require 'alaveteli_file_types'
require 'zip/zip'
@@ -30,7 +28,7 @@ class RequestController < ApplicationController
def select_authority
# Check whether we force the user to sign in right at the start, or we allow her
# to start filling the request anonymously
- if force_registration_on_new_request && !authenticated?(
+ if Configuration::force_registration_on_new_request && !authenticated?(
:web => _("To send your FOI request"),
:email => _("Then you'll be allowed to send FOI requests."),
:email_subject => _("Confirm your email address")
@@ -46,7 +44,7 @@ class RequestController < ApplicationController
end
def show
- if !MySociety::Config.get('VARNISH_HOST').nil?
+ if !Configuration::varnish_host.nil?
# If varnish is set up to accept PURGEs, then cache for a
# long time
long_cache
@@ -369,7 +367,7 @@ class RequestController < ApplicationController
replied by then.</p>
<p>If you write about this request (for example in a forum or a blog) please link to this page, and add an
annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full,
- :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20))
+ :late_number_of_days => Configuration::reply_late_after_days)
redirect_to show_new_request_path(:url_title => @info_request.url_title)
end
@@ -457,7 +455,7 @@ class RequestController < ApplicationController
flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'waiting_response_very_overdue'
- flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => MySociety::Config.get('REPLY_VERY_LATE_AFTER_DAYS', 40), :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20))
+ flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => Configuration::reply_very_late_after_days, :late_number_of_days => Configuration::reply_late_after_days)
redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'not_held'
flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p>
@@ -489,7 +487,7 @@ class RequestController < ApplicationController
elsif @info_request.calculate_status == 'gone_postal'
redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
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 {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20), :review_url => unhappy_url(@info_request) + "#internal_review")
+ flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => Configuration.reply_late_after_days, :review_url => unhappy_url(@info_request) + "#internal_review")
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'error_message'
flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>")
@@ -875,11 +873,10 @@ class RequestController < ApplicationController
if !File.exists?(file_path)
FileUtils.mkdir_p(File.dirname(file_path))
Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) { |zipfile|
- convert_command = MySociety::Config.get("HTML_TO_PDF_COMMAND")
+ convert_command = Configuration::html_to_pdf_command
done = false
if File.exists?(convert_command)
- domain = MySociety::Config.get("DOMAIN")
- url = "http://#{domain}#{request_url(info_request)}?print_stylesheet=1"
+ url = "http://#{Configuration::domain}#{request_url(info_request)}?print_stylesheet=1"
tempfile = Tempfile.new('foihtml2pdf')
output = AlaveteliExternalCommand.run(convert_command, url, tempfile.path)
if !output.nil?
diff --git a/app/controllers/request_game_controller.rb b/app/controllers/request_game_controller.rb
index f22652dd1..4b6f02970 100644
--- a/app/controllers/request_game_controller.rb
+++ b/app/controllers/request_game_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: request_game_controller.rb,v 1.9 2009-10-19 22:06:54 francis Exp $
class RequestGameController < ApplicationController
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 40e0faaf7..ead5d73b7 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -6,7 +6,7 @@ class ServicesController < ApplicationController
def other_country_message
text = ""
- iso_country_code = MySociety::Config.get('ISO_COUNTRY_CODE').downcase
+ iso_country_code = Configuration::iso_country_code.downcase
if country_from_ip.downcase != iso_country_code
found_country = WorldFOIWebsites.by_code(country_from_ip)
found_country_name = !found_country.nil? && found_country[:country_name]
@@ -36,9 +36,9 @@ class ServicesController < ApplicationController
:content_type => "text/plain",
:layout => false,
:locals => {:name_to => info_request.user_name,
- :name_from => MySociety::Config.get("CONTACT_NAME", 'Alaveteli'),
+ :name_from => Configuration::contact_name,
:info_request => info_request, :reason => params[:reason],
- :info_request_url => 'http://' + MySociety::Config.get('DOMAIN') + request_url(info_request),
+ :info_request_url => 'http://' + Configuration::domain + request_url(info_request),
:site_name => site_name}
end
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index 1a21491b1..8e76b4c9f 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -4,8 +4,6 @@
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: track_controller.rb,v 1.31 2009-09-02 14:18:26 francis Exp $
class TrackController < ApplicationController
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 0a9e1d781..810b3321e 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -3,8 +3,6 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: user_controller.rb,v 1.71 2009-09-17 07:51:47 francis Exp $
require 'set'
@@ -138,7 +136,7 @@ class UserController < ApplicationController
# Login form
def signin
work_out_post_redirect
- @request_from_foreign_country = country_from_ip != MySociety::Config.get('ISO_COUNTRY_CODE', 'GB')
+ @request_from_foreign_country = country_from_ip != Configuration::iso_country_code
# make sure we have cookies
if session.instance_variable_get(:@dbman)
if not session.instance_variable_get(:@dbman).instance_variable_get(:@original)
@@ -192,7 +190,7 @@ class UserController < ApplicationController
# Create new account form
def signup
work_out_post_redirect
- @request_from_foreign_country = country_from_ip != MySociety::Config.get('ISO_COUNTRY_CODE', 'GB')
+ @request_from_foreign_country = country_from_ip != Configuration::iso_country_code
# Make the user and try to save it
@user_signup = User.new(params[:user_signup])
error = false