当前位置: 首页>>代码示例>>PHP>>正文


PHP check_security函数代码示例

本文整理汇总了PHP中check_security函数的典型用法代码示例。如果您正苦于以下问题:PHP check_security函数的具体用法?PHP check_security怎么用?PHP check_security使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_security函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

        $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;
    ?>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:build_search.php

示例2: check_security

<?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] != ".") {
开发者ID:carriercomm,项目名称:xmec,代码行数:31,代码来源:plugin.php

示例3: browse_dir

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;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:100,代码来源:protect.php


注:本文中的check_security函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。