本文整理汇总了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;
?>
示例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] != ".") {
示例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> </th>
<th> </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> </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;
}