Sha256: 2b169ef19d0c14ff7b608c5e39f96fe72e13f46eae904e887500137384e7f3d6

Contents?: true

Size: 1.31 KB

Versions: 30

Compression:

Stored size: 1.31 KB

Contents

class RegistrationsController < Devise::RegistrationsController

  skip_before_filter :require_no_authentication #Devise bug?
  layout :application_layout

  def index
  end

  def new
    @group = Group.find_by_name(params[:group])
    super
  end

  def create
    @group = Group.find(params[:user][:requested_group]) if params[:user][:requested_group] 
    super
    unless @user.new_record?
      Registrations.group_user_registration_email(
        @group, @user, edit_groups_user_url(@user.groups_users.last)
      ).deliver
    end
  end

  def update
    super
  end

  # show confirmation for registration of existing users
  def confirm
  end

  def login
    # redirected to here after AJAX login
    if user_signed_in?
      render :json => {
        :success => true,
        :user => {
          :login => current_user.login,
          :email => current_user.email,
          :name => current_user.name,
          :app_infos => current_user.app_infos
        },
        :roles => current_roles.roles.collect(&:name)
      }
    else
      render :json => {
        :success => false, :user => {}, :roles => []
      }
    end
  end

  def logout
    render :nothing => true
  end

  private

  def after_sign_up_path_for(resource)
    user_welcome_path
  end

  def application_layout
    params[:layout] || "application"
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
gb_mapfish_appserver-2.0.0 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.1.1 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.1.0 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.6 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.5 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.4 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.3 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.2 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.1 app/controllers/registrations_controller.rb
gb_mapfish_appserver-1.0.0 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.7 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.6 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.5 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.4 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.3 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.2 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.1 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.9.0 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.8.7 app/controllers/registrations_controller.rb
gb_mapfish_appserver-0.8.6 app/controllers/registrations_controller.rb