web/drupal/modules/openid/openid.install
branchdrupal
changeset 74 0ff3ba646492
equal deleted inserted replaced
73:fcf75e232c5b 74:0ff3ba646492
       
     1 <?php
       
     2 // $Id: openid.install,v 1.3.2.1 2009/01/06 15:46:37 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   return $schema;
       
    70 }