You are here

aes.install in AES encryption 5

Same filename and directory in other branches
  1. 8.2 aes.install
  2. 6 aes.install
  3. 7 aes.install

File

aes.install
View source
<?php

// $Id $
function aes_install() {
  drupal_install_schema("aes");
  variable_set("aes_key_storage_method", "Database");
  variable_set("aes_cipher", "rijndael-128");
  variable_set("aes_convert", "true");
  variable_set("aes_viewing_method", "collapsible");
  drupal_set_message(t("AES installed."));
}
function aes_schema() {
  $schema['aes_passwords'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => true,
        'not null' => true,
        'default' => 0,
      ),
      'pass' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => true,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}
function aes_uninstall() {

  //delete keyfile
  if (variable_get("aes_key_storage_method", "") == "File") {
    unlink(variable_get("aes_key_path", ""));
  }
  drupal_uninstall_schema("aes");

  //delete variables
  variable_del("aes_key");
  variable_del("aes_convert");
  variable_del("aes_key_storage_method");
  variable_del("aes_key_path");
  variable_del("aes_key");
  variable_del("aes_encryption_iv");
  variable_del("aes_cipher");
  variable_del("aes_viewing_method");
  drupal_set_message(t("AES uninstalled."));
}

Functions