function og_role_watchdog_og_role_revoke in Role Watchdog 7.2
Same name and namespace in other branches
- 7 modules/og_role_watchdog/og_role_watchdog.module \og_role_watchdog_og_role_revoke()
File
- modules/
og_role_watchdog/ og_role_watchdog.module, line 96 - Logs changes to user roles.
Code
function og_role_watchdog_og_role_revoke($entity_type, $gid, $uid, $rid) {
// When a user is denied membership to a group, og_role_watchdog_og_membership_delete
// will be called, and then og_role_watchdog_og_role_revoke will be called with
// $rid == 1 (OG_ANONYMOUS_ROLE).
$group = entity_load_single($entity_type, $gid);
$roles = array_flip(og_roles($entity_type, $group->type, $gid));
$nonmember_rid = $roles[OG_ANONYMOUS_ROLE];
if ($rid != $nonmember_rid) {
$account = user_load($uid);
_og_role_watchdog_process_role_changes($account, array(), array(
$rid,
), $gid);
}
}