Exemple #1
0
function isModerator($id)
{
    global $USERINFO;
    static $modlist = NULL;
    # Not logged in
    if (empty($_SERVER['REMOTE_USER'])) {
        return false;
    }
    if (is_null($modlist)) {
        $modlist = parseModlist(loadModlist());
    }
    # Check nearest non-root parent namespace
    for ($ns = getNS($id); $ns; $ns = getNS($ns)) {
        $wildcard = $ns . ':*';
        if (!empty($modlist[$wildcard])) {
            return in_array($modlist[$wildcard], $USERINFO['grps']);
        }
    }
    # Check root namespace
    if (!empty($modlist['*'])) {
        return in_array($modlist['*'], $USERINFO['grps']);
    }
    # No moderator group set for any of parent namespaces
    return false;
}
Exemple #2
0
 /**
  * Get current ACL settings as multidim array
  *
  * @author Andreas Gohr <*****@*****.**>
  */
 function _init_acl_config()
 {
     global $AUTH_ACL;
     $this->acl = parseModlist($AUTH_ACL);
 }