function invite_load_from_context in Invite 7.2
Returns an invite object from an invite code stored in the user's session.
Return value
An invite object, or FALSE if no invite code can be found.
3 calls to invite_load_from_context()
- invite_find_invite in ./
invite.module - Finds the invitation to assign to the new account when the user is registering.
- invite_form_alter in ./
invite.module - Implements hook_form_alter().
- invite_user_register_access in ./
invite.module - Access callback; determine access to user registration form.
File
- ./
invite.module, line 497 - Allows your users to send and track invitations to join your site.
Code
function invite_load_from_context() {
if (isset($_SESSION[INVITE_SESSION])) {
$invite = invite_load($_SESSION[INVITE_SESSION]);
}
elseif (arg(0) == 'user' && arg(1) == 'register' && ($code = arg(2))) {
if ($invite = invite_load($code)) {
$_SESSION[INVITE_SESSION] = $invite->reg_code;
}
}
if (!empty($invite)) {
return $invite;
}
else {
return FALSE;
}
}