Skip to content
Snippets Groups Projects
Commit 84829ec5 authored by Brendan Anderson's avatar Brendan Anderson Committed by Sascha Grossenbacher
Browse files

Issue #3392203 by bander2: This module prevents Drupal from installing from configuration

parent 08812ea3
No related branches found
No related tags found
1 merge request!34Issue #3289683 by Berdir, japerry, Project Update Bot: New 4.x branch for...
Pipeline #46285 passed with warnings
......@@ -12,21 +12,22 @@ use Drupal\Core\Site\Settings;
/**
* Implements hook_install().
*/
function simplesamlphp_auth_install() {
user_role_revoke_permissions(AccountInterface::AUTHENTICATED_ROLE, ['change own password']);
// Disable the open registration to the site and store the original setting.
$user_settings = \Drupal::configFactory()->getEditable('user.settings');
$config = \Drupal::configFactory()->getEditable('simplesamlphp_auth.settings');
$config->set('user_register_original', $user_settings->get('register'));
$user_settings->set('register', 'admin_only');
$user_settings->save();
// Inform the user about disabling the open registration.
\Drupal::messenger()->addMessage(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.', [
':user_settings_url' => Url::fromRoute('entity.user.admin_form')->toString(),
]), 'warning');
$config->save();
function simplesamlphp_auth_install($is_syncing) {
if (!$is_syncing) {
user_role_revoke_permissions(AccountInterface::AUTHENTICATED_ROLE, ['change own password']);
// Disable the open registration to the site and store the original setting.
$user_settings = \Drupal::configFactory()->getEditable('user.settings');
$config = \Drupal::configFactory()->getEditable('simplesamlphp_auth.settings');
$config->set('user_register_original', $user_settings->get('register'));
$user_settings->set('register', 'admin_only');
$user_settings->save();
// Inform the user about disabling the open registration.
\Drupal::messenger()->addMessage(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.', [
':user_settings_url' => Url::fromRoute('entity.user.admin_form')->toString(),
]), 'warning');
$config->save();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment