# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_contact_session_id' before_filter :get_contactgroups # HACK - do something more advanced here:-) @@magic_password = '' def ApplicationController.application_password @@magic_password end private def authorize unless session[:valid_login] session[:original_uri] = request.request_uri # flash[:notice] = "Please log in" redirect_to(:controller => "login" , :action => "login" ) end end def get_contactgroups @contactgroups = Contactgroup.find(:all) end end