function invite_user_presave in Invite 7.2
Same name and namespace in other branches
- 8 invite.module \invite_user_presave()
- 7.4 invite.module \invite_user_presave()
Implements hook_user_presave().
File
- ./
invite.module, line 665 - Allows your users to send and track invitations to join your site.
Code
function invite_user_presave(&$edit, $account, $category) {
if ($account->is_new && !empty($account->mail)) {
$invite = invite_find_invite($account->mail);
if ($invite) {
$roles = invite_target_roles($invite, $edit);
if ($roles) {
if (!isset($edit['roles']) || !is_array($edit['roles'])) {
$edit['roles'] = array();
}
foreach ($roles as $role) {
$edit['roles'][$role] = $role;
}
}
}
}
}