You are here

bakery.install in Bakery Single Sign-On System 8.2

Db table for bakery functionlities.

File

bakery.install
View source
<?php

/**
 * @file
 * Db table for bakery functionlities.
 */

/**
 * Implements hook_schema().
 */
function bakery_schema() {
  return [
    'bakery_user' => [
      'description' => 'Keep track of UID on subsites, master only.',
      'fields' => [
        'uid' => [
          'description' => 'User ID on master site.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ],
        'slave' => [
          'description' => 'Slave site.',
          'type' => 'varchar',
          'length' => 128,
          'not null' => TRUE,
        ],
        'slave_uid' => [
          'description' => 'User ID on slave site.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ],
      ],
      'primary key' => [
        'uid',
        'slave',
      ],
    ],
  ];
}

/**
 * Ensure subsite login default.
 */
function bakery_update_8001() {
  \Drupal::configFactory()
    ->getEditable('bakery.settings')
    ->set('subsite_login', FALSE)
    ->save();
}

Functions

Namesort descending Description
bakery_schema Implements hook_schema().
bakery_update_8001 Ensure subsite login default.