You are here

recovery_pass.install in Recovery Password (Email New Password) 7

Same filename and directory in other branches
  1. 8 recovery_pass.install

Install, update, and uninstall functions for the Recovery Password module.

File

recovery_pass.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Recovery Password module.
 */

/**
 * Implements hook_schema().
 */
function recovery_pass_schema() {
  $schema['recovery_pass'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'UID of user.',
      ),
      'old_pass' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => 255,
        'description' => 'stores temp old pass',
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'stores request created time',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'foreign keys' => array(
      'recovery_pass_uid' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function recovery_pass_uninstall() {
  variable_del('recovery_pass_help_text');
  variable_del('recovery_pass_email_subject');
  variable_del('recovery_pass_email_text');
  variable_del('recovery_pass_old_pass_show');
  variable_del('recovery_pass_old_pass_warning');
  variable_del('recovery_pass_fpass_redirect');
  variable_del('recovery_pass_expiry_period');
}

Functions