From 6e052f7e0e973b9e80f3decc7488d8ef0e9f4904 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 8 Nov 2012 16:10:06 +0000 Subject: Remove unused method. --- app/helpers/application_helper.rb | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ab953cb25..5c856383b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -77,25 +77,6 @@ module ApplicationHelper return LanguageNames::get_language_name(locale) end - # Use our own algorithm for finding path of cache - def foi_cache(name = {}, options = nil, &block) - if @controller.perform_caching - key = name.merge(:only_path => true) - key_path = @controller.foi_fragment_cache_path(key) - - if @controller.foi_fragment_cache_exists?(key_path) - cached = @controller.foi_fragment_cache_read(key_path) - output_buffer.concat(cached) - return - end - - pos = output_buffer.length - content = block.call - @controller.foi_fragment_cache_write(key_path, output_buffer[pos..-1]) - else - block.call - end - end # (unfortunately) ugly way of getting id of generated form element # ids # see http://chrisblunt.com/2009/10/12/rails-getting-the-id-of-form-fields-inside-a-fields_for-block/ -- cgit v1.2.3 From 75927f8684a1aa0bf89479306e8adce384781e64 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 20 Nov 2012 17:34:08 +0000 Subject: 3093f5d97d89dfa3518babe00d3aefea9cde15ad contained a reversion for WDTK - where due to the proxied admin interface, we can't rely on a shared session between front end and admin interface requests. So show the admin bar for all superusers. --- app/helpers/application_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5c856383b..6411cf27e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -112,5 +112,12 @@ module ApplicationHelper return "#{exact_date} (#{ago_text})" end + # Note that if the admin interface is proxied via another server, we can't + # rely on a sesssion being shared between the front end and admin interface, + # so need to check the status of the user. + def is_admin? + return !session[:using_admin].nil? || (!@user.nil? && @user.super?) + end + end -- cgit v1.2.3