[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/modules/openid/ -> openid.install (source)

   1  <?php
   2  
   3  /**
   4   * Implementation of hook_install().
   5   */
   6  function openid_install() {
   7    // Create table.
   8    drupal_install_schema('openid');
   9  }
  10  
  11  /**
  12   * Implementation of hook_uninstall().
  13   */
  14  function openid_uninstall() {
  15    // Remove table.
  16    drupal_uninstall_schema('openid');
  17  }
  18  
  19  /**
  20   * Implementation of hook_schema().
  21   */
  22  function openid_schema() {
  23    $schema['openid_association'] = array(
  24      'description' => 'Stores temporary shared key association information for OpenID authentication.',
  25      'fields' => array(
  26        'idp_endpoint_uri' => array(
  27          'type' => 'varchar',
  28          'length' => 255,
  29          'description' => 'URI of the OpenID Provider endpoint.',
  30        ),
  31        'assoc_handle' => array(
  32          'type' => 'varchar',
  33          'length' => 255,
  34          'not null' => TRUE,
  35          'description' => 'Primary Key: Used to refer to this association in subsequent messages.',
  36        ),
  37        'assoc_type' => array(
  38          'type' => 'varchar',
  39          'length' => 32,
  40          'description' => 'The signature algorithm used: one of HMAC-SHA1 or HMAC-SHA256.',
  41        ),
  42        'session_type' => array(
  43          'type' => 'varchar',
  44          'length' => 32,
  45          'description' => 'Valid association session types: "no-encryption", "DH-SHA1", and "DH-SHA256".',
  46        ),
  47        'mac_key' => array(
  48          'type' => 'varchar',
  49          'length' => 255,
  50          'description' => 'The MAC key (shared secret) for this association.',
  51        ),
  52        'created' => array(
  53          'type' => 'int',
  54          'not null' => TRUE,
  55          'default' => 0,
  56          'description' => 'UNIX timestamp for when the association was created.',
  57        ),
  58        'expires_in' => array(
  59          'type' => 'int',
  60          'not null' => TRUE,
  61          'default' => 0,
  62          'description' => 'The lifetime, in seconds, of this association.',
  63        ),
  64      ),
  65      'primary key' => array('assoc_handle'),
  66    );
  67  
  68    $schema['openid_nonce'] = array(
  69      'description' => 'Stores received openid.response_nonce per OpenID endpoint URL to prevent replay attacks.',
  70      'fields' => array(
  71        'idp_endpoint_uri' => array(
  72          'type' => 'varchar',
  73          'length' => 255,
  74          'description' => 'URI of the OpenID Provider endpoint.',
  75        ),
  76        'nonce' => array(
  77          'type' => 'varchar',
  78          'length' => 255,
  79          'description' => 'The value of openid.response_nonce'
  80        ),
  81        'expires' => array(
  82          'type' => 'int',
  83          'not null' => TRUE,
  84          'default' => 0,
  85          'description' => 'A Unix timestamp indicating when the entry should expire.',
  86        ),
  87      ),
  88      'indexes' => array(
  89        'nonce' => array('nonce'),
  90        'expires' => array('expires'),
  91      ),
  92    );
  93  
  94    return $schema;
  95  }
  96  
  97  /**
  98   * @defgroup updates-6.x-extra Extra openid updates for 6.x
  99   * @{
 100   */
 101  
 102  /**
 103   * Add the openid_nonce table.
 104   *
 105   * Implementation of hook_update_N().
 106   */
 107  function openid_update_6000() {
 108    $ret = array();
 109  
 110    $schema['openid_nonce'] = array(
 111      'description' => 'Stores received openid.response_nonce per OpenID endpoint URL to prevent replay attacks.',
 112      'fields' => array(
 113        'idp_endpoint_uri' => array(
 114          'type' => 'varchar',
 115          'length' => 255,
 116          'description' => 'URI of the OpenID Provider endpoint.',
 117        ),
 118        'nonce' => array(
 119          'type' => 'varchar',
 120          'length' => 255,
 121          'description' => 'The value of openid.response_nonce'
 122        ),
 123        'expires' => array(
 124          'type' => 'int',
 125          'not null' => TRUE,
 126          'default' => 0,
 127          'description' => 'A Unix timestamp indicating when the entry should expire.',
 128        ),
 129      ),
 130      'indexes' => array(
 131        'nonce' => array('nonce'),
 132        'expires' => array('expires'),
 133      ),
 134    );
 135  
 136    db_create_table($ret, 'openid_nonce', $schema['openid_nonce']);
 137  
 138    return $ret;
 139  }
 140  
 141  /**
 142   * @} End of "defgroup updates-6.x-extra"
 143   * The next series of updates should start at 7000.
 144   */


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7