diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ability.rb | 5 | ||||
-rw-r--r-- | lib/configuration.rb | 3 | ||||
-rw-r--r-- | lib/cookie_store_with_line_break_fix.rb | 19 | ||||
-rw-r--r-- | lib/make_html_4_compliant.rb | 8 |
4 files changed, 25 insertions, 10 deletions
diff --git a/lib/ability.rb b/lib/ability.rb new file mode 100644 index 000000000..2865ccb1c --- /dev/null +++ b/lib/ability.rb @@ -0,0 +1,5 @@ +module Ability + def self.can_update_request_state?(user, request) + (user && request.is_old_unclassified?) || request.is_owning_user?(user) + end +end
\ No newline at end of file diff --git a/lib/configuration.rb b/lib/configuration.rb index 6d2bed66d..f76a1f533 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -14,9 +14,7 @@ MySociety::Config.load_default module AlaveteliConfiguration DEFAULTS = { - :ADMIN_BASE_URL => '', :ADMIN_PASSWORD => '', - :ADMIN_PUBLIC_URL => '', :ADMIN_USERNAME => '', :AVAILABLE_LOCALES => '', :BLACKHOLE_PREFIX => 'do-not-reply-to-this-address', @@ -30,6 +28,7 @@ module AlaveteliConfiguration :EXCEPTION_NOTIFICATIONS_FROM => '', :EXCEPTION_NOTIFICATIONS_TO => '', :FORCE_REGISTRATION_ON_NEW_REQUEST => false, + :FORCE_SSL => true, :FORWARD_NONBOUNCE_RESPONSES_TO => 'user-support@localhost', :FRONTPAGE_PUBLICBODY_EXAMPLES => '', :GA_CODE => '', diff --git a/lib/cookie_store_with_line_break_fix.rb b/lib/cookie_store_with_line_break_fix.rb new file mode 100644 index 000000000..dc623fbd0 --- /dev/null +++ b/lib/cookie_store_with_line_break_fix.rb @@ -0,0 +1,19 @@ +# See https://makandracards.com/makandra/9443-rails-2-s-cookiestore-produces-invalid-cookie-data-causing-tests-to-break + +# Should be able to remove this when we upgrade to Rails 3 + +module ActionController + module Session + CookieStore.class_eval do + + def call_with_line_break_fix(*args) + status, headers, body = call_without_line_break_fix(*args) + headers['Set-Cookie'].gsub! "\n\n", "\n" if headers['Set-Cookie'].present? + [ status, headers, body ] + end + + alias_method_chain :call, :line_break_fix + + end + end +end
\ No newline at end of file diff --git a/lib/make_html_4_compliant.rb b/lib/make_html_4_compliant.rb deleted file mode 100644 index 8926d5873..000000000 --- a/lib/make_html_4_compliant.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Monkeypatch! Output HTML 4.0 compliant code, using method described in this -# ticket: http://dev.rubyonrails.org/ticket/6009 - -ActionView::Helpers::TagHelper.module_eval do - def tag(name, options = nil, open = false, escape = true) - "<#{name}#{tag_options(options, escape) if options}#{open ? ">" : ">"}".html_safe - end -end |