You are here

function cas_update_8001 in CAS 2.x

Same name and namespace in other branches
  1. 8 cas.install \cas_update_8001()

Adds the 'created' field to the cas_login_data table and new related config.

File

./cas.install, line 92
The Drupal install file.

Code

function cas_update_8001(&$sandbox) {
  $created_spec = [
    'type' => 'int',
    'description' => 'The timestamp when this user session was created.',
    'length' => 11,
    'not null' => TRUE,
  ];
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->addField('cas_login_data', 'created', $created_spec);
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('cas.settings');
  $config
    ->set('logout.single_logout_session_lifetime', 25);
  $config
    ->save(TRUE);
}