You are here

email_confirm.install in Email Change Confirmation 7

Same filename and directory in other branches
  1. 5 email_confirm.install
  2. 6 email_confirm.install

Install, update, & uninstall functions for Email Change Confirmation module.

File

email_confirm.install
View source
<?php

/**
 * @file
 * Install, update, & uninstall functions for Email Change Confirmation module.
 */

/**
 * Updates email confirmation text to use new token patterns.
 */
function email_confirm_update_7000() {
  $map = array(
    '!username' => '[user:name]',
    '!site' => '[site:name]',
    '!email_url' => '[email_confirm:email_url]',
  );
  $variables = array(
    'email_confirm_confirmation_email_subject',
    'email_confirm_confirmation_email_body',
    'email_confirm_confirmation_original_email_body',
  );
  foreach ($variables as $variable) {
    $var = variable_get($variable, '');
    if (drupal_strlen($var)) {
      $new_var = str_replace(array_keys($map), array_values($map), $var);
      variable_set($variable, $new_var);
    }
  }
}

/**
 * Implements hook_uninstall().
 */
function email_confirm_uninstall() {
  variable_del('email_confirm_confirmation_email_subject');
  variable_del('email_confirm_confirmation_email_author');
  variable_del('email_confirm_confirmation_email_bcc');
  variable_del('email_confirm_confirmation_email_body');
  variable_del('email_confirm_confirmation_original_email_body');
  variable_del('email_confirm_hash_salt');
  variable_del('email_confirm_timeout');
}

Functions

Namesort descending Description
email_confirm_uninstall Implements hook_uninstall().
email_confirm_update_7000 Updates email confirmation text to use new token patterns.