/[drupal]/contributions/modules/password_policy/password_policy.install
ViewVC logotype

Contents of /contributions/modules/password_policy/password_policy.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Sun Oct 26 11:21:06 2008 UTC (12 months, 4 weeks ago) by miglius
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA2, HEAD
Changes since 1.6: +2 -3 lines
File MIME type: text/x-php
password_policy: changing db column type for compatability, #325787
1 <?php
2 // $Id: password_policy.install,v 1.6 2008/10/09 10:33:19 miglius Exp $
3 /**
4 * @file
5 * File module installation and upgrade code.
6 */
7
8 //////////////////////////////////////////////////////////////////////////////
9 // Core API hooks
10
11 /**
12 * Implementation of hook_enable().
13 */
14 function password_policy_enable() {
15 drupal_set_message(t('Password policy module successfully installed. Please review the available <a href="@settings">configuration settings</a>.', array('@settings' => url('admin/settings/password_policy'))));
16 }
17
18 /**
19 * Implementation of hook_install().
20 */
21 function password_policy_install() {
22 drupal_install_schema('password_policy');
23 }
24
25 /**
26 * Implementation of hook_uninstall().
27 */
28 function password_policy_uninstall() {
29 drupal_uninstall_schema('password_policy');
30 variable_del('password_policy_admin');
31 variable_del('password_policy_begin');
32 variable_del('password_policy_block');
33 variable_del('password_policy_show_restrictions');
34 variable_del('password_policy_warning_subject');
35 variable_del('password_policy_warning_body');
36 }
37
38 //////////////////////////////////////////////////////////////////////////////
39 // Schema API hooks
40
41 /**
42 * Implementation of hook_schema().
43 */
44 function password_policy_schema() {
45 return array(
46 'password_policy' => array(
47 'description' => t("Stores password policies."),
48 'fields' => array(
49 'pid' => array(
50 'description' => t("Primary Key: Unique password policy ID."),
51 'type' => 'serial',
52 'not null' => TRUE,
53 ),
54 'name' => array(
55 'description' => t("The name of the policy."),
56 'type' => 'varchar',
57 'length' => 64,
58 'not null' => TRUE,
59 'default' => '',
60 ),
61 'description' => array(
62 'description' => t("The description of the policy."),
63 'type' => 'varchar',
64 'length' => 255,
65 'default' => '',
66 ),
67 'enabled' => array(
68 'description' => t("Whether the policy is enabled."),
69 'type' => 'int',
70 'not null' => TRUE,
71 'default' => 0,
72 'size' => 'tiny',
73 ),
74 'policy' => array(
75 'description' => t("The policy's serialized data."),
76 'type' => 'text',
77 'not null' => TRUE,
78 'default' => '',
79 ),
80 'created' => array(
81 'description' => t("Timestamp for when the policy was created."),
82 'type' => 'int',
83 'not null' => TRUE,
84 'default' => 0,
85 ),
86 'expiration' => array(
87 'description' => t("The passwords will expire after this number of days."),
88 'type' => 'int',
89 ),
90 'warning' => array(
91 'description' => t("Comma separated list of days when warning is sent out."),
92 'type' => 'varchar',
93 'length' => 64,
94 ),
95 ),
96 'primary key' => array('pid'),
97 ),
98 'password_policy_history' => array(
99 'description' => t("Stores users' old password hashes."),
100 'fields' => array(
101 'pid' => array(
102 'description' => t("Primary Key: Unique password policy users ID."),
103 'type' => 'serial',
104 'not null' => TRUE,
105 ),
106 'uid' => array(
107 'description' => t("User's {users}.uid."),
108 'type' => 'int',
109 'not null' => TRUE,
110 ),
111 'pass' => array(
112 'description' => t("User's password (md5 hash)."),
113 'type' => 'varchar',
114 'length' => 32,
115 'not null' => TRUE,
116 ),
117 'created' => array(
118 'description' => t("Timestamp for when the policy was created."),
119 'type' => 'int',
120 'not null' => TRUE,
121 ),
122 ),
123 'primary key' => array('pid'),
124 'indexes' => array('uid' => array('uid')),
125 ),
126 'password_policy_expiration' => array(
127 'description' => t('Stores users password expiration data.'),
128 'fields' => array(
129 'pid' => array(
130 'description' => t("Primary Key: Unique password policy expirations ID."),
131 'type' => 'serial',
132 'not null' => TRUE,
133 ),
134 'uid' => array(
135 'description' => t("User's {users}.uid."),
136 'type' => 'int',
137 'not null' => TRUE,
138 'default' => 0,
139 ),
140 'warning' => array(
141 'description' => t("Timestamp for when the warning was shown."),
142 'type' => 'int',
143 ),
144 'blocked' => array(
145 'description' => t("Timestamp for when the user was blocked."),
146 'type' => 'int',
147 ),
148 'unblocked' => array(
149 'description' => t("Timestamp for when the user was unblocked."),
150 'type' => 'int',
151 ),
152 ),
153 'primary key' => array('pid'),
154 'indexes' => array('uid' => array('uid')),
155 ),
156 );
157 }
158

  ViewVC Help
Powered by ViewVC 1.1.2