Sha256: 604248d77c3583cd36799fe18ad1d856019bf9fce970c97689471e3e101673cc

Contents?: true

Size: 750 Bytes

Versions: 20

Compression:

Stored size: 750 Bytes

Contents

class Muck::ActivationsController < ApplicationController
  unloadable
  
  ssl_required :new
  before_filter :not_logged_in_required, :only => [:new]
  
  def new
    @user = User.find_using_perishable_token(params[:id])
    if @user.blank?
      flash[:notice] = t('muck.users.activation_not_found')
      redirect_to new_user_path and return
    end
    
    if @user.active?
      flash[:notice] = t('muck.users.already_activated')
      redirect_to login_path and return
    end
    
    if @user.activate!
      UserSession.create(@user)
      flash[:notice] = t('muck.users.account_activated')
      @user.deliver_activation_confirmation!
      redirect_to welcome_user_path(@user)
    else
      render :action => :new
    end
    
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
muck-users-0.3.20 app/controllers/muck/activations_controller.rb
muck-users-0.3.19 app/controllers/muck/activations_controller.rb
muck-users-0.3.18 app/controllers/muck/activations_controller.rb
muck-users-0.3.17 app/controllers/muck/activations_controller.rb
muck-users-0.3.16 app/controllers/muck/activations_controller.rb
muck-users-0.3.15 app/controllers/muck/activations_controller.rb
muck-users-0.3.14 app/controllers/muck/activations_controller.rb
muck-users-0.3.13 app/controllers/muck/activations_controller.rb
muck-users-0.3.12 app/controllers/muck/activations_controller.rb
muck-users-0.3.11 app/controllers/muck/activations_controller.rb
muck-users-0.3.10 app/controllers/muck/activations_controller.rb
muck-users-0.3.9 app/controllers/muck/activations_controller.rb
muck-users-0.3.8 app/controllers/muck/activations_controller.rb
muck-users-0.3.7 app/controllers/muck/activations_controller.rb
muck-users-0.3.6 app/controllers/muck/activations_controller.rb
muck-users-0.3.4 app/controllers/muck/activations_controller.rb
muck-users-0.3.3 app/controllers/muck/activations_controller.rb
muck-users-0.3.2 app/controllers/muck/activations_controller.rb
muck-users-0.3.1 app/controllers/muck/activations_controller.rb
muck-users-0.3.0 app/controllers/muck/activations_controller.rb