Sha256: e65d7debaf65e46048f761e886c243eea55f58b75f7128ecf5274cc58cac6c9d

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

class Clearance::UsersController < ApplicationController
  unloadable

  skip_before_filter :authenticate, :only => [:new, :create]
  before_filter :redirect_to_root,  :only => [:new, :create], :if => :signed_in?
  filter_parameter_logging :password

  def new
    @user = ::User.new(params[:user])
    render :template => 'users/new'
  end

  #Here the email login users are created, FB user creation is managed in the fb controller
  def create
    @user = ::User.new params[:user]
    if @user.save
      flash_notice_after_create
      sign_in(@user) #Login recently created user
      redirect_to(url_after_create)
    else
      render :template => 'users/new'
    end
  end

  private

  def flash_notice_after_create
    flash[:notice] = translate(:deliver_confirmation,
      :scope   => [:clearance, :controllers, :users],
      :default => "You will receive an email within the next few minutes. " <<
                  "It contains instructions for confirming your account.")
  end

  def url_after_create
    sign_in_url
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fbdoorman-0.9.1 app/controllers/clearance/users_controller.rb
fbdoorman-0.9.0 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.98 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.97 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.95 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.94 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.93 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.92 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.91 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.9 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.8 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.7 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.6 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.5 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.4 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.2 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0.1 app/controllers/clearance/users_controller.rb
fbdoorman-0.8.0 app/controllers/clearance/users_controller.rb
fbdoorman-0.7.9.1 app/controllers/clearance/users_controller.rb
fbdoorman-0.7.9 app/controllers/clearance/users_controller.rb