You are here

tfa.install in Two-factor Authentication (TFA) 7

Same filename and directory in other branches
  1. 8 tfa.install
  2. 6 tfa.install
  3. 7.2 tfa.install

File

tfa.install
View source
<?php

/**
 * @file tfa.install
 */

/**
 * Implements hook_schema().
 */
function tfa_schema() {
  $schema['tfa'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Primary Key: {users}.uid for user.',
      ),
      'code' => array(
        'type' => 'varchar',
        'length' => 160,
        'not null' => TRUE,
        'default' => '',
      ),
      'accepted' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'indexes' => array(
      'code' => array(
        'code',
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function tfa_uninstall() {
  variable_del('tfa_hourly_threshold');
  variable_del('tfa_send_message');
  variable_del('tfa_code_length');
  variable_del('tfa_channel');
  variable_del('tfa_phone_field');
}

Functions

Namesort descending Description
tfa_schema Implements hook_schema().
tfa_uninstall Implements hook_uninstall().