You are here

function paranoia_mail in Paranoia 7

Implements hook_mail().

File

./paranoia.module, line 562
Paranoia module file. Provides various extra security features.

Code

function paranoia_mail($key, &$message, $params) {
  switch ($key) {
    case 'paranoia_expired':
      $account = user_load($params['uid']);
      $options = array(
        'langcode' => $message['language']->language,
      );
      $message['subject'] = t('@site-name account password randomized', array(
        '@site-name' => variable_get('site_name', 'Drupal'),
      ), $options);
      $message['body'][] = t("@name,\n\nAs a security precaution, since you have not logged in to your account for\n@threshold days, the password on the account has been randomized.", array(
        '@name' => $account->name,
        '@threshold' => variable_get('paranoia_access_threshold', 730),
      ), $options);
      $message['body'][] = check_plain($params['message']);
      break;
  }
}