You are here

function notifications_subscription_destination_subform_validate in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications_account/notifications_account.module \notifications_subscription_destination_subform_validate()

Validate submitted destination

1 string reference to 'notifications_subscription_destination_subform_validate'
notifications_subscription_destination_subform in ./notifications.module
Add destination subform

File

./notifications.module, line 517
Notifications module

Code

function notifications_subscription_destination_subform_validate($form, &$form_state) {
  notifications_include('destination.inc');

  // Get destination from form and check it is ok for an anonymous user
  $dest = notifications_destination_parse_submitted($form_state['values'], TRUE);
  if (!empty($dest['method']) && !empty($dest['address'])) {

    // Set destination field so we don't validate again send method later
    $form_state['values']['destination'] = TRUE;

    // Set send method in case we need some more validation for the subscription
    $form_state['values']['send_method'] = $dest['method'];
  }
}