You are here

function invite_validate in Invite 7.4

Same name and namespace in other branches
  1. 5.2 invite.module \invite_validate()
  2. 6.2 invite.module \invite_validate()
  3. 7.2 invite.module \invite_validate()

Checks the status of an invite.

Parameters

object $invite: An invite object as returned by invite_load().

Return value

int The constant corresponding to the status of the invite.

1 call to invite_validate()
invite_user_register_access in ./invite.module
Access callback; determine access to user registration form.

File

./invite.module, line 348

Code

function invite_validate($invite) {
  if (!$invite || $invite->canceled != 0) {
    return INVITE_WITHDRAWN;
  }
  elseif ($invite->joined != 0) {
    return INVITE_USED;
  }
  elseif ($invite->expiry < REQUEST_TIME) {
    return INVITE_EXPIRED;
  }
  else {
    return INVITE_VALID;
  }
}