Ejemplo n.º 1
0
function list_S3QL($element, $D)
{
    extract($D);
    if ($element == 'projects') {
        $data = list_projects($D);
    }
    if ($element == 'resources' || $element == 'classes') {
        $data = list_classes($D);
        #$data = list_shared_resources ($D);
        #if($data=='')
        #$data = list_project_resources ($D);
    }
    if ($element == 'users') {
        #$data = list_users($D);
        $data = list_all_users($D);
    }
    if ($element == 'keys') {
        $data = list_keys($D);
    }
    if ($element == 'accesslog') {
        $data = list_logs($D);
    }
    if ($element == 'rules') {
        $data = list_rules($D);
    }
    if ($element == 'rulelog') {
        $data = list_rules_log($D);
    }
    if ($element == 'resource instances') {
        $data = list_all_instances($D);
    }
    if ($element == 'statements') {
        $data = list_statements($D);
        if (is_array($data)) {
            $data = array_map('ValuesToFileLinks', $data);
        }
    }
    #echo '<pre>';print_r($data);
    #After the query, resume the cols that are supposed to be displayed
    if ($D['out'] != '' && $D['out'] != '*') {
        if ($SQLfun == 'distinct') {
            $D['out'] = str_replace(array($SQLfun, "(", ")"), "", $D['out']);
        }
        $cols = array_map('trimmit', explode(',', $D['out']));
    }
    for ($c = 0; $c < count($cols); $c++) {
        $pCol = $cols[$c];
        if ($c == count($cols) - 1) {
            $header .= trim($pCol);
        } else {
            $header .= trim($pCol) . $format['middle'];
        }
    }
    $x = array('data' => $data, 'format' => $format, 'header' => $header, 'columns' => $cols);
    if ($data != '') {
        echo display($x);
    } else {
        echo "<report>Your query returned no results</report>";
    }
}
Ejemplo n.º 2
0
<?php

if (!user_admin()) {
    include PATH_GLOBAL_VIEW . 'error_not_admin.php';
} else {
    require_once PATH_MODEL . 'admin.php';
    $tbx = list_all_users();
    include PATH_VIEW . 'view_users.php';
}
//end of user_admin