/** * Checks to see if current user has access to a admin moderation page * * @return boolean */ function SEC_hasModerationAccess() { global $_CONF; $hasAccess = false; if (SEC_hasRights('story.moderate')) { $hasAccess = true; } if ($_CONF['listdraftstories'] == 1) { if (SEC_hasRights('story.edit')) { $hasAccess = true; } } if ($_CONF['commentsubmission'] == 1) { if (SEC_hasRights('comment.moderate')) { $hasAccess = true; } } if ($_CONF['usersubmission'] == 1) { if (SEC_hasRights('user.edit') && SEC_hasRights('user.delete')) { $hasAccess = true; } } if (PLG_isModerator()) { $hasAccess = false; } return $hasAccess; }
/** * Determines if current user is a moderator of any kind * * Checks to see if this user is a moderator for any of the GL features OR * GL plugins * * @return boolean returns if user has any .moderate rights * */ function SEC_isModerator() { global $_USER, $_RIGHTS; // Loop through GL core rights. for ($i = 0; $i < count($_RIGHTS); $i++) { if (stristr($_RIGHTS[$i], '.moderate')) { return true; } } // If we get this far they are not a glFusion moderator // So, let's return if they're a plugin moderator return PLG_isModerator(); }