webmaster@1
|
1 <?php |
webmaster@1
|
2 // $Id: openid.install,v 1.3 2007/10/10 11:39:33 goba Exp $ |
webmaster@1
|
3 |
webmaster@1
|
4 /** |
webmaster@1
|
5 * Implementation of hook_install(). |
webmaster@1
|
6 */ |
webmaster@1
|
7 function openid_install() { |
webmaster@1
|
8 // Create table. |
webmaster@1
|
9 drupal_install_schema('openid'); |
webmaster@1
|
10 } |
webmaster@1
|
11 |
webmaster@1
|
12 /** |
webmaster@1
|
13 * Implementation of hook_uninstall(). |
webmaster@1
|
14 */ |
webmaster@1
|
15 function openid_uninstall() { |
webmaster@1
|
16 // Remove table. |
webmaster@1
|
17 drupal_uninstall_schema('openid'); |
webmaster@1
|
18 } |
webmaster@1
|
19 |
webmaster@1
|
20 /** |
webmaster@1
|
21 * Implementation of hook_schema(). |
webmaster@1
|
22 */ |
webmaster@1
|
23 function openid_schema() { |
webmaster@1
|
24 $schema['openid_association'] = array( |
webmaster@1
|
25 'description' => t('Stores temporary shared key association information for OpenID authentication.'), |
webmaster@1
|
26 'fields' => array( |
webmaster@1
|
27 'idp_endpoint_uri' => array( |
webmaster@1
|
28 'type' => 'varchar', |
webmaster@1
|
29 'length' => 255, |
webmaster@1
|
30 'description' => t('URI of the OpenID Provider endpoint.'), |
webmaster@1
|
31 ), |
webmaster@1
|
32 'assoc_handle' => array( |
webmaster@1
|
33 'type' => 'varchar', |
webmaster@1
|
34 'length' => 255, |
webmaster@1
|
35 'not null' => TRUE, |
webmaster@1
|
36 'description' => t('Primary Key: Used to refer to this association in subsequent messages.'), |
webmaster@1
|
37 ), |
webmaster@1
|
38 'assoc_type' => array( |
webmaster@1
|
39 'type' => 'varchar', |
webmaster@1
|
40 'length' => 32, |
webmaster@1
|
41 'description' => t('The signature algorithm used: one of HMAC-SHA1 or HMAC-SHA256.'), |
webmaster@1
|
42 ), |
webmaster@1
|
43 'session_type' => array( |
webmaster@1
|
44 'type' => 'varchar', |
webmaster@1
|
45 'length' => 32, |
webmaster@1
|
46 'description' => t('Valid association session types: "no-encryption", "DH-SHA1", and "DH-SHA256".'), |
webmaster@1
|
47 ), |
webmaster@1
|
48 'mac_key' => array( |
webmaster@1
|
49 'type' => 'varchar', |
webmaster@1
|
50 'length' => 255, |
webmaster@1
|
51 'description' => t('The MAC key (shared secret) for this association.'), |
webmaster@1
|
52 ), |
webmaster@1
|
53 'created' => array( |
webmaster@1
|
54 'type' => 'int', |
webmaster@1
|
55 'not null' => TRUE, |
webmaster@1
|
56 'default' => 0, |
webmaster@1
|
57 'description' => t('UNIX timestamp for when the association was created.'), |
webmaster@1
|
58 ), |
webmaster@1
|
59 'expires_in' => array( |
webmaster@1
|
60 'type' => 'int', |
webmaster@1
|
61 'not null' => TRUE, |
webmaster@1
|
62 'default' => 0, |
webmaster@1
|
63 'description' => t('The lifetime, in seconds, of this association.'), |
webmaster@1
|
64 ), |
webmaster@1
|
65 ), |
webmaster@1
|
66 'primary key' => array('assoc_handle'), |
webmaster@1
|
67 ); |
webmaster@1
|
68 |
webmaster@1
|
69 return $schema; |
webmaster@1
|
70 } |