Sha256: e765ec77787598e7001b61b23e1299d1975eaf1861fc51dda45f7cbca10d1a7f

Contents?: true

Size: 1.13 KB

Versions: 12

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_back_or_default login_path }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
muck-users-0.1.4 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.5 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.6 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.7 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.8 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.9 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.10 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.11 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.3 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.1 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.2 app/controllers/muck/user_sessions_controller.rb
muck-users-0.1.0 app/controllers/muck/user_sessions_controller.rb