cas-8.x-1.x-dev/cas.install

cas.install
<?php

/**
 * @file
 * The Drupal install file.
 */

declare(strict_types=1);

/**
 * Implements hook_schema().
 */
function cas_schema(): array {
  $schema = [];

  $schema['cas_login_data'] = [
    'description' => "Store CAS login data for single sign out purposes.",
    'fields' => [
      'sid' => [
        'description' => "A session ID (hashed). The value is generated by Drupal's session handlers.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ],
      'plainsid' => [
        'description' => 'An un-hashed session ID.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ],
      'ticket' => [
        'description' => "A CAS service ticket.",
        'type' => 'varchar',
        'length' => 256,
        'not null' => TRUE,
        'default' => '',
      ],
      'created' => [
        'description' => 'The timestamp when this user session was created.',
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'sid',
    ],
    'indexes' => [
      'ticket' => ['sid'],
    ],
    'foreign keys' => [
      'session_user' => [
        'table' => 'session',
        'columns' => ['sid' => 'sid'],
      ],
    ],
  ];

  $schema['cas_pgt_storage'] = [
    // Database table for storing PGT/PGTIOU relationships.
    'description' => 'Stores PGT/PGTIOU relationships.',
    'fields' => [
      'pgt_iou' => [
        'description' => 'PGTIOU is the key returned from the CAS server for the PGT',
        'type' => 'varchar_ascii',
        'length' => 256,
        'not null' => TRUE,
      ],
      'pgt' => [
        'description' => 'The actual ProxyGrantingTicket value.',
        'type' => 'varchar_ascii',
        'length' => 256,
        'not null' => TRUE,
      ],
      'timestamp' => [
        'description' => 'Created time. Used to delete unused, stale PGTs',
        'type' => 'int',
        'not null' => TRUE,
      ],
    ],
    'unique keys' => [
      'pgtiou_pgt' => ['pgt_iou', 'pgt'],
    ],
    'primary key' => ['pgt_iou'],
  ];
  return $schema;
}

/**
 * Implements hook_update_last_removed().
 */
function cas_update_last_removed(): int {
  return 8005;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc