class ApplicationController < ActionController::Base include ExceptionLoggable, BrowserFilters, AuthenticationSystem # Hub single sign-on support. Run the Hub filters for all actions to # ensure activity timeouts etc. work properly. The login integration # with Hub is done using modifications to the forum's own mechanism # in lib/authentication_system.rb. require 'hub_sso_lib' include HubSsoLib::Core before_filter :hubssolib_beforehand after_filter :hubssolib_afterwards # Beast's usual preamble. helper_method :current_user, :logged_in?, :admin?, :last_active before_filter :login_by_token protected def last_active session[:last_active] ||= Time.now.utc end def rescue_action(exception) exception.is_a?(ActiveRecord::RecordInvalid) ? render_invalid_record(exception.record) : super end def render_invalid_record(record) render :action => (record.new_record? ? 'new' : 'edit') end end