You are here

function aes_install in AES encryption 6

Same name and namespace in other branches
  1. 8.2 aes.install \aes_install()
  2. 5 aes.install \aes_install()

File

./aes.install, line 48

Code

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");
  $aes_implementations = aes_get_available_aes_implementations();
  if ($aes_implementations['mcrypt']) {
    variable_set("aes_implementation", "mcrypt");
    $install_msg = t("AES installed using the Mcrypt implementation.");
  }
  else {
    if ($aes_implementations['phpseclib']) {
      variable_set("aes_implementation", "phpseclib");
      $install_msg = t("AES installed using the phpseclib implementation.");
    }
    else {

      //this case shouldn't actually be possible since hook_requirements should stop the installation if there's no implementation
      variable_set("aes_implementation", "missing");
      $install_msg = t("AES installed without any implementation!");
    }
  }
  drupal_set_message($install_msg);
}