Add Login system
[cs356-p2-videostore.git] / app / controllers / application.rb
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.
3
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'
7
8   private
9
10   def authorize
11     unless User.find_by_id(session[:user_id])
12       flash[:notice] = "Please log in"
13       redirect_to :controller => "login", :action => "login"
14     end
15   end
16 end