Sha256: 97839b92802528fcaa0de219a0a95730bda011c0873ba8f10b67dd8256fe856b

Contents?: true

Size: 1.13 KB

Versions: 17

Compression:

Stored size: 1.13 KB

Contents

class Muck::UserSessionsController < ApplicationController
  unloadable
  
  ssl_required :new, :create
  before_filter :login_required, :only => :destroy
  before_filter :not_logged_in_required, :only => [:new, :create]
  
  def new
    @title = t('muck.users.sign_in_title')
    @user_session = UserSession.new
    respond_to do |format|
      format.html { render :template => 'user_sessions/new' }
    end
  end
  
  def create
    @title = t('muck.users.sign_in_title')
    @user_session = UserSession.new(params[:user_session])
    if @user_session.save
      flash[:notice] = t('muck.users.login_success')
      respond_to do |format|
        format.html { redirect_back_or_default user_path(@user_session.user) }
      end
    else
      flash[:notice] = t('muck.users.login_fail')
      respond_to do |format|
        format.html { render :template => 'user_sessions/new' }
      end
    end
  end
  
  def destroy
    @title = t('muck.users.sign_out_title')
    current_user_session.destroy
    flash[:notice] = t('muck.users.login_out_success')
    respond_to do |format|
      format.html { redirect_to logout_complete_path }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
muck-users-0.2.14 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.13 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.12 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.11 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.10 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.9 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.6 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.7 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.8 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.12 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.13 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.0 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.1 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.2 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.3 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.4 app/controllers/muck/user_sessions_controller.rb
muck-users-0.2.5 app/controllers/muck/user_sessions_controller.rb