Project

General

Profile

Paste
Download (1.43 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / recovery_pass / recovery_pass.install @ 7dbec6b0

1
<?php
2
/**
3
 * @file
4
 * Install, update, and uninstall functions for the Recovery Password module.
5
 */
6

    
7
/**
8
 * Implements hook_schema().
9
 */
10
function recovery_pass_schema() {
11
  $schema['recovery_pass'] = array(
12
    'fields' => array(
13
      'id' => array(
14
        'type' => 'serial',
15
        'unsigned' => TRUE,
16
        'not null' => TRUE,
17

    
18
      ),
19
      'uid' => array(
20
        'type' => 'int',
21
        'unsigned' => TRUE,
22
        'not null' => TRUE,
23
        'description' => 'UID of user.',
24
      ),
25
      'old_pass' => array(
26
        'type' => 'varchar',
27
        'not null' => TRUE,
28
        'length' => 255,
29
        'description' => 'stores temp old pass',
30
      ),
31
      'changed' => array(
32
        'type' => 'int',
33
        'not null' => TRUE,
34
        'default' => 0,
35
        'description' => 'stores request created time',
36
      ),
37
    ),
38
    'primary key' => array('id'),
39
    'foreign keys' => array(
40
      'recovery_pass_uid' => array(
41
        'table' => 'users',
42
        'columns' => array('uid' => 'uid'),
43
      ),
44
    ),
45
  );
46
  return $schema;
47
}
48

    
49
/**
50
 * Implements hook_uninstall().
51
 */
52
function recovery_pass_uninstall() {
53
  variable_del('recovery_pass_help_text');
54
  variable_del('recovery_pass_email_subject');
55
  variable_del('recovery_pass_email_text');
56
  variable_del('recovery_pass_old_pass_show');
57
  variable_del('recovery_pass_old_pass_warning');
58
  variable_del('recovery_pass_fpass_redirect');
59
  variable_del('recovery_pass_expiry_period');
60
}