Esempio n. 1
0
        $filter = array("type" => GET('type_' . $i), "subtype" => GET('subtype_' . $i), "value" => $value, "value2" => $value2, "match" => GET('match_' . $i));
    }
    $results[$i] = array();
    $perc = $i / $num * 100;
    // Save search
    $_SESSION['inventory_last_search'][$i] = $filter;
    $criterias[$filter['type']][$filter['subtype']] = $filter['value'] != "" ? $filter['value'] : "(is true)";
    // Advanced: get query from rules. UserFriendly: get query from filter array
    $q = GET('userfriendly') ? $filter['query'] : $rules[$filter['type']][$filter['subtype']]['query'];
    $m = GET('userfriendly') ? $filter['query_match'] : $rules[$filter['type']][$filter['subtype']]['match'];
    // For FixedText
    if ($m == 'fixedText') {
        $value2 = !empty($filter['value2']) ? $filter['value2'] : null;
        check_security($filter['value'], $m, $value2, GET('userfriendly'));
    } else {
        check_security($filter['value'], $m, NULL, GET('userfriendly'));
    }
    if ($rules[$filter['type']][$filter['subtype']]['match'] == "concat") {
        list($query, $params) = build_concat_query($q, $filter['value'], $filter['match'], "concat");
    } elseif ($m == 'fixedText') {
        list($query, $params) = build_query_two_values($q, $filter['value'], $filter['value2'], $filter['match'], $m);
    } else {
        list($query, $params) = build_query($q, $filter['value'], $filter['match'], $m);
    }
    //echo "Filter $i: ".$filter['type']." ".$filter['subtype']." ".$filter['value']." ".$filter['match']."<br>";
    //print_r($params);
    //echo "SQL: ".$query."<br><br>";
    ?>
<script type="text/javascript">$("#pbar").progressBar(<?php 
    echo $perc;
    ?>
Esempio n. 2
0
<?php

check_security();
/* Plugin Managment */
if (@$do == "props" && !empty($plugin)) {
    $plugindirname = $plugin;
    $pluginprops = TRUE;
    include "./plugin/{$plugin}/admin.php";
} else {
    if (isset($action) && isset($plugin)) {
        if ($action == "activate_plugin") {
            $PHORUM["plugins"][$plugin] = true;
            QueMessage("Plugin Activated.");
        } elseif ($action == "deactivate_plugin") {
            $PHORUM["plugins"][$plugin] = false;
            QueMessage("Plugin Deactivated.");
        }
        writefile();
    }
    ?>
<p>
<table border="0" cellspacing="0" cellpadding="3" class="box-table">
<tr>
<td colspan="2" align="center" valign="middle" class="table-header">Manage Plugins</td>
</tr>
<tr>
<?php 
    $dir = opendir("./plugin/");
    $num = 0;
    while ($plugindirname = readdir($dir)) {
        if ($plugindirname[0] != ".") {
Esempio n. 3
0
function browse_dir($vars)
{
    global $config;
    $dir_delim_re = substr(php_uname(), 0, 7) == "Windows" ? '{/|\\\\}' : '{/}';
    $dir_delim = substr(php_uname(), 0, 7) == "Windows" ? "\\" : "/";
    $dir = $vars['dir'];
    ##current
    $init_dir = $vars['init_dir'];
    ## 0/1 (set if it open from old config)
    if ($dir == '') {
        $dir = $config['root_dir'];
    }
    $dir =& clean_path($dir);
    if (!check_security($dir)) {
        fatal_error("You are not allowed to view {$dir}", 1);
    }
    $dirs = preg_split($dir_delim_re, $dir);
    $dir_link = $dir_delim;
    $p = $dir_delim;
    foreach ($dirs as $s) {
        if ($s == '') {
            continue;
        }
        $p .= $s . $dir_delim;
        if (check_security($p)) {
            $dir_link .= "<a href=\"protect.php?action=browse_dir&dir={$p}\"><b>{$s}</b></a>{$dir_delim}";
        } else {
            $dir_link .= "<b>{$s}</b>{$dir_delim}";
        }
    }
    if ($dh = opendir($dir)) {
    } else {
        die("Cannot open directory: {$dir}");
    }
    print <<<CUT
    <html><head><title>Select Directory</title>
        <style> 
            body,td,th,input { 
                font-family: 'Helvetica', sans-serif; 
                font-size: 0.8em; }
            td { background-color: #F0F0F0;}
        </style>
        <script>
            function clicked(rd){
                window.opener.browse_dir_clicked(rd.value);
                window.close();
            }
        </script>
    <body bgcolor=white>    
    <center>
    <b>Contents of directory {$dir_link}</b>
    <table align=center bgcolor=#E0E0E0 cellpadding=3>
    <tr>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>Directory</th>
        <th>Mode</th>
        <th>Created</th>
    </tr>
CUT;
    if (check_security($x = "{$dir}..") && is_dir($x) && $dir != $dir_delim) {
        print <<<CUT
    <tr>
        <td>&nbsp;</td>
        <td align=center><b>..</b></td>
        <td colspan=3><a href="protect.php?action=browse_dir&dir={$dir}..">.. <b>Previous Directory</b></td>
    </tr>   
    <form>
CUT;
    }
    while ($fn = readdir($dh)) {
        $file = "{$dir}{$fn}";
        if (!is_dir($file)) {
            continue;
        }
        $file .= "{$dir_delim}";
        $stat = stat($file);
        if (preg_match('/^\\.|\\.\\.$/', $fn)) {
            continue;
        }
        $mode = format_permissions($stat[3]);
        $cdate = format_file_date($stat[10]);
        print <<<CUT
    <tr>
        <td><input type=radio name=dir value="{$file}" onclick='clicked(this)'></td>
        <td align=center><b>D</b></td>
        <td><a href="protect.php?action=browse_dir&dir={$file}"><b>{$fn}</b></a></td>
        <td nowrap>{$mode}</td>
        <td nowrap>{$cdate}</td>
    </tr>
CUT;
    }
    closedir($dh);
    print <<<CUT
    </form>
    </table>
    </center>
    </body></html>
CUT;
}