You are here

function security_review_check_email_passwords in Security Review 6

1 call to security_review_check_email_passwords()
security_review_check_email_passwords_help in ./security_review.help.inc
1 string reference to 'security_review_check_email_passwords'
_security_review_security_checks in ./security_review.inc
Checks for security_review_security_checks() or security_review_get_checks().

File

./security_review.inc, line 699
Stand-alone security checks and review system.

Code

function security_review_check_email_passwords($last_check = NULL) {
  $result = TRUE;
  drupal_load('module', 'user');
  $mail_templates = array(
    'register_no_approval_required_subject',
    'register_no_approval_required_body',
    'register_admin_created_subject',
    'register_admin_created_body',
    'register_pending_approval_subject',
    'register_pending_approval_admin_subject',
    'register_pending_approval_body',
    'register_pending_approval_admin_body',
    'password_reset_subject',
    'password_reset_body',
    'status_activated_subject',
    'status_activated_body',
    'status_blocked_subject',
    'status_blocked_body',
    'status_deleted_subject',
    'status_deleted_body',
  );
  $check_result_value = array();
  foreach ($mail_templates as $template_name) {
    $text = _user_mail_text($template_name);
    if (strpos($text, '!password') !== FALSE) {
      $check_result_value[] = $template_name;
    }
  }
  if (!empty($check_result_value)) {
    $result = FALSE;
  }
  return array(
    'result' => $result,
    'value' => $check_result_value,
  );
}