Skip to content
Extraits de code Groupes Projets
registrations_controller.rb 777 octets
Newer Older
  • Learn to ignore specific revisions
  • Raphael's avatar
    Raphael a validé
    #   Copyright (c) 2010, Diaspora Inc.  This file is
    
    Raphael's avatar
    Raphael a validé
    #   licensed under the Affero General Public License version 3 or later.  See
    
    #   the COPYRIGHT file.
    
    class RegistrationsController < Devise::RegistrationsController
    
      before_filter :check_registrations_open!
    
    
          flash[:notice] = I18n.t 'registrations.create.success'
    
          sign_in_and_redirect(:user, @user)
    
          flash[:error] = @user.errors.full_messages.join(', ')
    
    
      def new
        super
      end
    
      private
      def check_registrations_open!
        if APP_CONFIG[:registrations_closed]
          flash[:error] = t('registrations.closed')
    
          redirect_to new_user_session_path