You are here

function comment_notify_comment_validate in Comment Notify 7

Same name and namespace in other branches
  1. 8 comment_notify.module \comment_notify_comment_validate()
1 string reference to 'comment_notify_comment_validate'
comment_notify_form_comment_form_alter in ./comment_notify.module
Implements hook_form_FORM_ID_alter() for comment_form().

File

./comment_notify.module, line 225
This module provides comment follow-up e-mail notification for anonymous and registered users.

Code

function comment_notify_comment_validate($comment) {
  global $user;

  // We assume that if they are non-anonymous then they have a valid mail.
  // For anonymous users, though, we verify that they entered a mail and let
  // comment.module validate it is real.
  if (!$user->uid && $comment['comment_notify_settings']['notify']['#value'] && empty($comment['author']['mail']['#value'])) {
    form_set_error('mail', t('If you want to subscribe to comments you must supply a valid e-mail address.'));
  }
}