gitlab-org--gitlab-foss/app/controllers/registrations_controller.rb
2013-09-04 16:20:40 +03:00

24 lines
494 B
Ruby

class RegistrationsController < Devise::RegistrationsController
before_filter :signup_enabled?
def destroy
current_user.destroy
respond_to do |format|
format.html { redirect_to new_user_session_path, notice: "Account successfully removed." }
end
end
protected
def build_resource(hash=nil)
super
self.resource.with_defaults
end
private
def signup_enabled?
redirect_to new_user_session_path unless Gitlab.config.gitlab.signup_enabled
end
end