Restrict new user registration via hook_install() instead of config/install.

This commit is contained in:
Michael Stenta 2021-09-06 09:19:10 -04:00
parent 434b473e14
commit 345464c6ad
2 changed files with 3 additions and 16 deletions

View File

@ -1,16 +0,0 @@
anonymous: Anonymous
verify_mail: true
notify:
cancel_confirm: true
password_reset: true
status_activated: true
status_blocked: false
status_canceled: false
register_admin_created: true
register_no_approval_required: true
register_pending_approval: true
register: admin_only
cancel_method: user_cancel_block
password_reset_timeout: 86400
password_strength: true
langcode: en

View File

@ -14,6 +14,9 @@ function farm_install() {
// Use private file system by default.
\Drupal::configFactory()->getEditable('system.file')->set('default_scheme', 'private')->save();
// Only allow admins to register new users.
\Drupal::configFactory()->getEditable('user.settings')->set('register', 'admin_only')->save();
}
/**