function flag_abuse_flag_access in Flag Abuse 7.2
Same name and namespace in other branches
- 6.2 flag_abuse.module \flag_abuse_flag_access()
File
- ./
flag_abuse.module, line 94
Code
function flag_abuse_flag_access($flag, $entity_id, $action, $account) {
$type = flag_abuse_get_api_type();
$content_flags = flag_get_counts($flag->{$type}, $entity_id);
if (flag_abuse_is_abuse_flag($flag->name)) {
// Check to see if there is a whitelist flag
if (isset($content_flags['abuse_whitelist_' . $flag->{$type}]) && $content_flags['abuse_whitelist_' . $flag->{$type}] == 1) {
flag_reset_flag($flag, $entity_id);
return FALSE;
}
}
}