You are here

function paranoia_expired_mail_send in Paranoia 7

Sends an e-mail if a password has been reset.

Parameters

int $uid: The User ID of an account to email, to notify that the account's password has been randomized, since the account had not been accessed for a long period of time (the default threshold is 2 years).

1 call to paranoia_expired_mail_send()
paranoia_reset_password_for_uid in ./paranoia.module
Resets a password on a uid and sends a mail as appropriate.

File

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

Code

function paranoia_expired_mail_send($uid) {
  $account = user_load($uid);
  $params = array(
    'uid' => $account->uid,
  );

  // Send the mail, and check for success.
  $result = drupal_mail('paranoia', 'paranoia_expired', $account->mail, language_default(), $params);
  if ($result['result']) {
    watchdog('paranoia', 'Notification of randomized password sent to @account.', array(
      '@account' => $account->name,
    ), WATCHDOG_INFO);
  }
  else {
    watchdog('paranoia', 'There was a problem sending a notification message to @account.', array(
      '@account' => $account->name,
    ), WATCHDOG_ERROR);
  }
}