Skip to content

Commit

Permalink
Fixed a bug where PLG_isModerator didn't work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Sep 16, 2018
1 parent dc2a4b2 commit 870f19a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion system/lib-plugins.php
Expand Up @@ -396,10 +396,26 @@ function PLG_enableStateChange($type, $enable)
/**
* Checks to see if user is a plugin moderator
* Geeklog is asking if the user is a moderator for any installed plugins.
*
* @return bool
*/
function PLG_isModerator()
{
PLG_callFunctionForAllPlugins('ismoderator');
global $_PLUGINS;

foreach ($_PLUGINS as $piName) {
$function = 'plugin_ismoderator_' . $piName;
if (is_callable($function) && $function()) {
return true;
}
}

$function = 'CUSTOM_ismoderator';
if (is_callable($function) && $function()) {
return true;
}

return false;
}

/**
Expand Down

0 comments on commit 870f19a

Please sign in to comment.