saml_sp_drupal_login.install in SAML Service Provider 3.x
Same filename and directory in other branches
Update functions for the SAML SP Drupal Login module.
File
modules/saml_sp_drupal_login/saml_sp_drupal_login.installView source
<?php
/**
* @file
* Update functions for the SAML SP Drupal Login module.
*/
/**
* Fix mismatch between config form and schema.
*/
function saml_sp_drupal_login_update_8301() {
$config_factory = \Drupal::configFactory();
$config = $config_factory
->getEditable('saml_sp_drupal_login.config');
$data = $config
->get();
$old_keys = [
'request_account',
'site_mail',
'site_administrators',
];
foreach ($old_keys as $old) {
$new = 'account_request_' . $old;
if (array_key_exists($old, $data) && !array_key_exists($new, $data)) {
$config
->set($new, $data[$old]);
}
}
$config
->save(TRUE);
}
/**
* set new default path to redirect already authenticated user to if they try to authenticate again
*/
function saml_sp_drupal_login_update_8302() {
$config_factory = \Drupal::configFactory();
$config = $config_factory
->getEditable('saml_sp_drupal_login.config');
$config
->set('logged_in_redirect', '<front>');
$config
->save(TRUE);
}
Functions
Name | Description |
---|---|
saml_sp_drupal_login_update_8301 | Fix mismatch between config form and schema. |
saml_sp_drupal_login_update_8302 | set new default path to redirect already authenticated user to if they try to authenticate again |