You are here

function _antispam_is_node_moderator in AntiSpam 7

Same name and namespace in other branches
  1. 6 antispam.module \_antispam_is_node_moderator()
1 string reference to '_antispam_is_node_moderator'
antispam_menu in ./antispam.module
Implements hook_menu().

File

./antispam.module, line 376
Primary hook implementations for the Antispam module.

Code

function _antispam_is_node_moderator($moderator_types = array()) {
  global $user;

  // Admin.
  if ($user->uid == 1) {
    return TRUE;
  }
  if (empty($moderator_types)) {
    $moderator_types = antispam_get_moderator_types();
  }
  if (_antispam_is_moderator($moderator_types) && (!_antispam_is_moderator($moderator_types, $type = 'comments') || _antispam_moderator_types_count($moderator_types) > 1)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}