本文整理汇总了PHP中wfUtils::doNotCache方法的典型用法代码示例。如果您正苦于以下问题:PHP wfUtils::doNotCache方法的具体用法?PHP wfUtils::doNotCache怎么用?PHP wfUtils::doNotCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wfUtils
的用法示例。
在下文中一共展示了wfUtils::doNotCache方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do503
public function do503($secsToGo, $reason)
{
wfConfig::inc('total503s');
wfUtils::doNotCache();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
if ($secsToGo) {
header('Retry-After: ' . $secsToGo);
}
require_once 'wf503.php';
exit;
}
示例2: do503
public function do503($secsToGo, $reason)
{
$this->initLogRequest();
$this->currentRequest->statusCode = 403;
if (!$this->currentRequest->action) {
$this->currentRequest->action = 'blocked:wordfence';
}
if (!$this->currentRequest->actionDescription) {
$this->currentRequest->actionDescription = "blocked: " . $reason;
}
$this->logHit();
wfConfig::inc('total503s');
wfUtils::doNotCache();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
if ($secsToGo) {
header('Retry-After: ' . $secsToGo);
}
require_once 'wf503.php';
exit;
}
示例3: veryFirstAction
//.........这里部分代码省略.........
//Reset login failure counter
header('Location: ' . wp_login_url());
exit;
} else {
if ($_GET['func'] == 'unlockAllIPs') {
wordfence::status(1, 'info', "Request received via unlock email link to unblock all IPs.");
$wfLog->unblockAllIPs();
$wfLog->unlockAllIPs();
delete_transient('wflginfl_' . bin2hex(wfUtils::inet_pton(wfUtils::getIP())));
//Reset login failure counter
header('Location: ' . wp_login_url());
exit;
} else {
if ($_GET['func'] == 'disableRules') {
wfConfig::set('firewallEnabled', 0);
wfConfig::set('loginSecurityEnabled', 0);
wordfence::status(1, 'info', "Request received via unlock email link to unblock all IPs via disabling firewall rules.");
$wfLog->unblockAllIPs();
$wfLog->unlockAllIPs();
delete_transient('wflginfl_' . bin2hex(wfUtils::inet_pton(wfUtils::getIP())));
//Reset login failure counter
wfConfig::set('cbl_countries', '');
//unblock all countries
header('Location: ' . wp_login_url());
exit;
} else {
echo "Invalid function specified. Please check the link we emailed you and make sure it was not cut-off by your email reader.";
exit;
}
}
}
} else {
if ($wfFunc == 'detectProxy') {
wfUtils::doNotCache();
if (wfUtils::processDetectProxyCallback()) {
self::getLog()->getCurrentRequest()->action = 'scan:detectproxy';
//Exempt a valid callback from live traffic
echo wfConfig::get('detectProxyRecommendation', '-');
} else {
echo '0';
}
exit;
}
}
}
// Sync the WAF data with the database.
if (!WFWAF_SUBDIRECTORY_INSTALL && ($waf = wfWAF::getInstance())) {
try {
$configDefaults = array('apiKey' => wfConfig::get('apiKey'), 'isPaid' => wfConfig::get('isPaid'), 'siteURL' => site_url(), 'homeURL' => home_url(), 'whitelistedIPs' => (string) wfConfig::get('whitelisted'), 'howGetIPs' => (string) wfConfig::get('howGetIPs'), 'other_WFNet' => wfConfig::get('other_WFNet', true), 'pluginABSPATH' => ABSPATH);
foreach ($configDefaults as $key => $value) {
$waf->getStorageEngine()->setConfig($key, $value);
}
if (class_exists('wfWAFIPBlocksController')) {
wfWAFIPBlocksController::synchronizeConfigSettings();
}
if (empty($_GET['wordfence_syncAttackData'])) {
$lastAttackMicroseconds = $wpdb->get_var("SELECT MAX(attackLogTime) FROM {$wpdb->base_prefix}wfHits");
if (get_site_option('wordfence_lastSyncAttackData', 0) < time() - 4) {
if ($waf->getStorageEngine()->hasNewerAttackData($lastAttackMicroseconds)) {
if (get_site_option('wordfence_syncingAttackData') <= time() - 60) {
// Could be the request to itself is not completing, add ajax to the head as a workaround
$attempts = get_site_option('wordfence_syncAttackDataAttempts', 0);
if ($attempts > 10) {
add_action('wp_head', 'wordfence::addSyncAttackDataAjax');
add_action('login_head', 'wordfence::addSyncAttackDataAjax');
add_action('admin_head', 'wordfence::addSyncAttackDataAjax');
示例4: redirect
private function redirect($URL)
{
wfUtils::doNotCache();
wp_redirect($URL, 302);
exit;
}
示例5: site_url
<?php
wfUtils::doNotCache();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>You are temporarily locked out</title>
</head>
<body>
<h1>You are temporarily locked out</h1>
<p style="width: 500px;">
You have been temporarily locked out of this system. This means
that you will not be able to sign-in or use several other features that may compromise security.
Please try back in a short while.
<ul>
<li><a href="<?php
echo site_url();
?>
">Return to the site home page</a></li>
<li><a href="<?php
echo admin_url();
?>
">Attempt to return to the admin login page (you may still be locked out)</a></li>
</ul>
<br /><br />
<?php
require 'wfUnlockMsg.php';
示例6: ajax_logHuman_callback
public static function ajax_logHuman_callback()
{
wfUtils::doNotCache();
$hid = $_GET['hid'];
$hid = wfUtils::decrypt($hid);
if (!preg_match('/^\\d+$/', $hid)) {
exit;
}
$db = new wfDB();
global $wpdb;
$p = $wpdb->base_prefix;
$db->queryWrite("update LOW_PRIORITY {$p}" . "wfHits set jsRun=1 where id=%d", $hid);
if (!headers_sent()) {
//suppress content-type warning in chrome
header('Content-type: image/gif');
}
die("");
}