You are here

function _antispam_is_moderator in AntiSpam 7

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

File

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

Code

function _antispam_is_moderator($moderator_types = array(), $type = '') {
  global $user;

  // Admin.
  if ($user->uid == 1) {
    return TRUE;
  }
  if (empty($moderator_types)) {
    $moderator_types = antispam_get_moderator_types();
  }
  if (_antispam_moderator_types_count($moderator_types) > 0 && (empty($type) || isset($moderator_types[$type]))) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}