diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-04 15:26:57 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-04 15:28:12 +0200 |
commit | 5f54981846508daf9558f66ffd70d42d8213bea9 (patch) | |
tree | 0ccd822d4e04a3082bb4bf9adc6cdb981f05425e /app/controllers/auth | |
parent | 405c495c234d80a036a37052841850be29000d0b (diff) |
New admin setting: open/close registrations, with custom message, from the admin UI
Diffstat (limited to 'app/controllers/auth')
-rw-r--r-- | app/controllers/auth/registrations_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 501e66807..4881c074a 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -3,7 +3,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController layout :determine_layout - before_action :check_single_user_mode + before_action :check_enabled_registrations, only: [:new, :create] before_action :configure_sign_up_params, only: [:create] protected @@ -27,12 +27,12 @@ class Auth::RegistrationsController < Devise::RegistrationsController new_user_session_path end - def check_single_user_mode - redirect_to root_path if Rails.configuration.x.single_user_mode + def check_enabled_registrations + redirect_to root_path if Rails.configuration.x.single_user_mode || !Setting.open_registrations end - + private - + def determine_layout %w(edit update).include?(action_name) ? 'admin' : 'auth' end |