Sha256: ef5b9de0337890c119c567505e6344317bdfae1d5e0c72d43cac02a4923b515e
Contents?: true
Size: 882 Bytes
Versions: 4
Compression:
Stored size: 882 Bytes
Contents
class Spud::UserSessionsController < Spud::ApplicationController before_filter :require_no_user, :only => [:new, :create] before_filter :require_user, :only => :destroy layout 'spud/login/application' def new if SpudUser.all.count == 0 logger.debug "NO USERS!" redirect_to spud_setup_url() and return end @user_session = SpudUserSession.new end def create @user_session = SpudUserSession.new(params[:spud_user_session]) if @user_session.save flash[:notice] = "Login successful!" redirect_back_or_default spud_admin_root_path else render :action => :new end end def destroy current_user_session.destroy flash[:notice] = "Logout successful!" if !request.referer.blank? session[:return_to] = request.referer end redirect_back_or_default new_spud_user_session_url end end
Version data entries
4 entries across 4 versions & 1 rubygems