You are here

function invite_user_login in Invite 7.4

Implements hook_user_login().

File

./invite.module, line 779

Code

function invite_user_login($edit, $account) {
  $invite = invite_load_from_session();
  if ($invite && $invite
    ->status() == INVITE_VALID) {
    $invite->invitee = $account->uid;
    $invite->joined = REQUEST_TIME;
    $invite->status = INVITE_USED;
    entity_save('invite', $invite);
    if (isset($_SESSION)) {
      unset($_SESSION[INVITE_SESSION_CODE]);
    }
  }
}