Created
March 6, 2012 08:10
-
-
Save akinsgre/1984858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check that user is logged in | |
def require_user | |
logger.info "Require User" | |
if current_user.nil? | |
session[:link_back] = request.url | |
redirect_to login_path | |
false | |
end | |
end | |
def require_user_no_linkback | |
logger.info "Require User no linkback" | |
if current_user.nil? | |
redirect_to login_path | |
false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WindowsController < ApplicationController | |
before_filter :require_user_no_linkback, :except => [:index] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment