Пример #1
0
        throw new Exception("MySQL error {$this->adb->error} ", $this->adb->errno);
    } catch (Exception $e) {
        exit($this->vForceStop("0|Error No: " . $e->getCode() . " - " . $e->getMessage() . "|var error = true"));
    }
}
$uprives = array();
if ($dquery->num_rows > 0) {
    $w = 0;
    while ($dds = $dquery->fetch_array(MYSQLI_ASSOC)) {
        if ($w == 0) {
            $xname = $this->strPrint($dds['nome']);
            $_SESSION['userName'] = $xname;
        }
        $uprives[$dds['plugin']][$dds['app']][$dds['module']][$dds['action']][$dds['param']] = 1;
    }
}
# get current prives
$_SESSION['vuserGrants'] = isset($uprives) ? $uprives : false;
# execute plugin
# $v->appReadModules($__vtxPackModule__,$spack,$uprives);
//print_r($uprives);
$this->modules = $v->appReadModules($__vtxPackModule__, $spack, isset($_SESSION['vuserGrants']) ? $_SESSION['vuserGrants'] : array());
$this->set("apps", $v->vGetUserPrives(), true);
# get current privilleges
if (isset($_GET['vcache'])) {
    echo "<pre>";
    print_r($uprives);
    print_r($v->vGetUserPrives());
}
# force layout display
$this->vForcePlugin($this->vconf['path'], '/interface/menu/');
Пример #2
0
$inQuery .= "WHERE t3.id='{$vtkey}' ";
$dquery = $this->adb->query($inQuery);
# if error on query
if ($this->adb->error) {
    try {
        throw new Exception("MySQL error {$this->adb->error} ", $this->adb->errno);
    } catch (Exception $e) {
        exit($this->vForceStop("0|Error No: " . $e->getCode() . " - " . $e->getMessage() . "|var error = true"));
    }
}
$uprives = array();
if ($dquery->num_rows > 0) {
    $w = 0;
    while ($dds = $dquery->fetch_array(MYSQLI_ASSOC)) {
        if ($w == 0) {
            $xname = $this->strPrint($dds['nome']);
            $_SESSION['userName'] = $xname;
        }
        $uprives[$dds['plugin']][$dds['app']][$dds['module']][$dds['action']][$dds['param']] = 1;
    }
}
# get current prives
!isset($_SESSION['vuserGrants']) ? $_SESSION['vuserGrants'] = isset($uprives) ? $uprives : array() : $_SESSION['vuserGrants'];
if (isset($_GET['vcache'])) {
    echo "<pre>";
    print_r($uprives);
}
# execute plugin
$v->appReadModules($__vtxPackModule__, $spack, $_SESSION['vuserGrants']);
#endif;
exit($this->vForceStop(""));