function antispam_is_spam_moderator in AntiSpam 6
Same name and namespace in other branches
- 7 antispam.module \antispam_is_spam_moderator()
Is current user spam moderator?
Parameters
string Moderator Type (comments, node type or NULL).:
object The account to check; use current user if not given.:
Return value
boolean TRUE if current user is moderator of specified type; FALSE otherwise.
6 calls to antispam_is_spam_moderator()
- antispam_access_callback in ./
antispam.module - antispam_comment in ./
antispam.module - Implementation of hook_comment().
- antispam_form_alter in ./
antispam.module - Implementation of hook_form_alter().
- antispam_link in ./
antispam.module - Implementation of hook_link().
- antispam_nodeapi in ./
antispam.module - Implementation of hook_nodeapi().
File
- ./
antispam.module, line 1236
Code
function antispam_is_spam_moderator($moderator_type = NULL, $account = NULL) {
global $user;
if (is_null($account)) {
$account = $user;
}
$moderator_types = antispam_get_moderator_types($account);
if (is_null($moderator_type)) {
return count($moderator_types) > 0 ? TRUE : FALSE;
}
return isset($moderator_types[$moderator_type]);
}