You are here

saml_sp_drupal_login.install in SAML Service Provider 3.x

Update functions for the SAML SP Drupal Login module.

File

modules/saml_sp_drupal_login/saml_sp_drupal_login.install
View 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

Namesort descending 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