View source
<?php
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() {
if (variable_get("aes_key_storage_method", "") == "File") {
unlink(variable_get("aes_key_path", ""));
}
drupal_uninstall_schema("aes");
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."));
}