[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

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

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


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7