You are here

function invite_user_form_submit in Invite 7.2

Implements the submit function associated with user_profile_form.

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

File

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

Code

function invite_user_form_submit($form, &$form_state) {
  $account = $form['#user'];
  if (empty($form['inviter']['#default_value']) && !empty($form_state['inviter_account'])) {
    $inviter = $form_state['inviter_account'];
    if (!empty($inviter->uid)) {
      $invite = invite_create();
      $invite->email = $account->mail;
      $invite->uid = $inviter->uid;
      $invite->invitee = $account->uid;
      $invite->joined = REQUEST_TIME;
      invite_save($invite);
    }
  }
}