irm/include/User.php
/** Verify if the user has the specified privilege level.
     * Takes one of the following levels:
     *  # admin
     *  # tech
     *  # normal
     *  # port-only
     *
     * and returns true if the current user is of that level or higher,
     * and false if the current user only has a level below that specified.
     */
Verify if the user has the specified privilege level.
Takes one of the following levels:
# admin
# tech
# normal
# port-only

and returns true if the current user is of that level or higher,
and false if the current user only has a level below that specified.
Verify if the user has the specified privilege level . Takes one of the following levels : # admin # tech # normal # port - only and returns true if the current user is of that level or higher and false if the current user only has a level below that specified .
function permissionCheck($priv)
    {
        $authlevels = array('post-only', 'normal', 'tech', 'admin');
        for ($i = 0; $i < count($authlevels); $i++)
        {
            if ($authlevels[$i] == $priv)
            {
                break;
            }
        }
        if ($i >= count($authlevels))
        {
            trigger_error(sprintf(_("Auth level %s not found"), $authtype), E_USER_ERROR);
            die(__FILE__.":".__LINE__.": dying with fatal error\n");
            exit;
        }
        for (; $i < count($authlevels); $i++)
        {
            if ($authlevels[$i] == $this->udata['Type'])
            {
                return true;
            }
        }
        return false;
    }
function permissionCheck ( $ priv ) { $ authlevels = array ( 'post-only' , 'normal' , 'tech' , 'admin' ) ; for ( $ i = 0 ; $ i < count ( $ authlevels ) ; $ i ++ ) { if ( $ authlevels [ $ i ] == $ priv ) { break ; } } if ( $ i >= count ( $ authlevels ) ) { trigger_error ( sprintf ( _ ( " Auth level %s not found " ) , $ authtype ) , E_USER_ERROR ) ; die ( __FILE__ . " : " . __LINE__ . " : dying with fatal error \n " ) ; exit ; } for ( ; $ i < count ( $ authlevels ) ; $ i ++ ) { if ( $ authlevels [ $ i ] == $ this -> udata [ 'Type' ] ) { return true ; } } return false ; }
Verify if the user has the specified privilege level.
Verify if the user has the specified privilege level .
// First, get to the requested level in the level stack // Whoops, out the top means that the calling function didn't // give us a level we know about // Now look for the user's auth level in the levels still // remaining in the stack above the requested level.