engines/adva_user/lib/action_controller/authenticate_user.rb
# Will actually test to see if the user is authorized
Will actually test to see if the user is authorized
Will actually test to see if the user is authorized
def require_authentication
          %w(session password user).each do |c|
  	        %w(new create).each do |a|
              return if (controller_name == c) && (action_name == a)
            end
  	      end
          if current_user.nil? or current_user.anonymous?
            redirect_to login_url(:return_to => request.url) and false
          end
        end
def require_authentication %w( session password user ) . each do | c | %w( new create ) . each do | a | return if ( controller_name == c ) && ( action_name == a ) end end if current_user . nil? or current_user . anonymous? redirect_to login_url ( :return_to => request . url ) and false end end
Will actually test to see if the user is authorized
Will actually test to see if the user is authorized
# No matter what the app does a user can always login, forgot # password and register. The controllers provided by this # plugin alreaddy have these controllers/actions on an # exception list but this prevents a mistake an overridden # controller from preventing the normal login behavior. # If we cannot get the current user store the requested page # and send them to the login page.