function invite_validate in Invite 5.2
Same name and namespace in other branches
- 6.2 invite.module \invite_validate()
- 7.4 invite.module \invite_validate()
- 7.2 invite.module \invite_validate()
Validates an invite record.
Parameters
$invite: An invite record as returned by invite_load().
Return value
TRUE if the invite is valid, otherwise this function won't return.
2 calls to invite_validate()
- invite_controller in ./
invite.module - Menu callback; handle incoming requests for accepting an invite.
- invite_form_alter in ./
invite.module - Implementation of hook_form_alter().
File
- ./
invite.module, line 361 - Allows your users to send and track invitations to join your site.
Code
function invite_validate($invite) {
if (!$invite || !$invite->inviter) {
drupal_set_message(t('This invitation has been withdrawn.'));
drupal_goto();
}
else {
if ($invite->joined != 0) {
drupal_set_message(t('This invitation has already been used. Please login now with your username and password.'));
drupal_goto('user');
}
else {
if ($invite->expiry < time()) {
drupal_set_message(t('Sorry, this invitation has expired.'));
drupal_goto();
}
else {
return TRUE;
}
}
}
}