You are here

function acquia_spi_security_review_check_email_passwords in Acquia Connector 6.2

1 string reference to 'acquia_spi_security_review_check_email_passwords'
_acquia_spi_security_review_security_checks in acquia_spi/security_review.inc
Checks for acquia_spi_security_review_get_checks().

File

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

Code

function acquia_spi_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,
  );
}