You are here

function invite_inviter_validate in Invite 7.2

Implements the validate function associated with user_profile_form.

1 string reference to 'invite_inviter_validate'
invite_form_user_profile_form_alter in ./invite.module
Implements hook_form_FORM_ID_alter().

File

./invite.module, line 1732
Allows your users to send and track invitations to join your site.

Code

function invite_inviter_validate($element, &$form_state, $form) {
  if (!empty($element['#value'])) {
    $inviter = user_load_by_name($form_state['values']['inviter']);
    if (empty($inviter)) {
      form_set_error('inviter', t('An account with that email address does not exist.'));
    }
    else {
      $form_state['inviter_account'] = $inviter;
    }
  }
}