1 # Filters added to this controller apply to all controllers in the application.
2 # Likewise, all the methods added will be available for all controllers.
4 class ApplicationController < ActionController::Base
5 # Pick a unique cookie name to distinguish our session data from others'
6 session :session_key => '_prippropprix_session_id'
11 unless User.find_by_id(session[:user_id])
12 flash[:notice] = "Please log in"
13 redirect_to :controller => "login", :action => "login"
18 user = User.find_by_id(session[:user_id])
19 unless user and user.manager
20 flash[:notice] = "You must be a manager to access this page"
21 redirect_to :controller => "login", :action => "index"