function setup()
 {
     auth_set();
     perm_set();
 }
예제 #2
0
    }
    function add_perm($p)
    {
        $this->perm[$p] = $p;
    }
    function remove_perm($p = '')
    {
        if (!$p) {
            $this->perm = array();
        } else {
            $k = array_search($p, $this->perm);
            if ($k) {
                unset($this->perm[$k]);
            }
        }
    }
    function have_perm($p)
    {
        return in_array($p, $this->perm);
    }
}
function perm_unset()
{
    unset($GLOBALS['perm']);
}
function perm_set()
{
    $GLOBALS['perm'] = new Permission();
}
perm_set();