You are here

function inactive_user_custom_settings_validate in Inactive User 5

Same name and namespace in other branches
  1. 6 inactive_user.module \inactive_user_custom_settings_validate()

File

./inactive_user.module, line 209

Code

function inactive_user_custom_settings_validate($form_id, $edit) {
  $mails = explode(',', $edit['inactive_user_admin_email']);
  foreach ($mails as $mail) {
    if ($mail && !valid_email_address(trim($mail))) {
      $invalid[] = $mail;
      $count++;
    }
  }
  if ($count == 1) {
    form_set_error('inactive_user_admin_email', t('%mail is not a valid e-mail address', array(
      '%mail' => $invalid[0],
    )));
  }
  elseif ($count > 1) {
    form_set_error('inactive_user_admin_email', t('The following e-mail addresses are invalid: %mail', array(
      '%mail' => implode(', ', $invalid),
    )));
  }
}