Esempio n. 1
0
        array_push($hostNames, $calItem);
    }
}
// get and validate token
@($token = $_GET["t"]);
if (preg_match('/[^A-Za-z0-9]/', $token)) {
    $message = "Invalid token value.";
    ClickTale_Logger::Write($message);
    header("HTTP/1.0 403 " . $message);
    header("X-ClickTale-Fetcher:no-store");
    die($message);
}
// get part of token to use for debug and log
@($tok = substr($token, strlen($token) - 4));
// New ip filter
if (!ClickTale_IsAllowedIp($ipsMasks)) {
    if (!ClickTale_IsAllowedHostname($hostNames)) {
        if (!ClickTale_IsAllowedWildcard($wildCards)) {
            if (ClickTale_Settings::Instance()->FetcherUnauthorizedURL != "") {
                header('Location: ' . ClickTale_Settings::Instance()->FetcherUnauthorizedURL);
                die;
            } else {
                $message = "Request from unauthorized ip: " . $_SERVER["REMOTE_ADDR"] . ", user agent: " . $_SERVER["HTTP_USER_AGENT"] . ".";
                ClickTale_Logger::Write($message);
                header("HTTP/1.0 403 " . $message);
                header("X-ClickTale-Fetcher:no-store");
                die("Request from unauthorized source.");
            }
        }
    }
}
Esempio n. 2
0
foreach ($settingsInstance as $var => $value) {
    echo "<b>{$var}</b><br>{$value}<br>";
}
?>
<b>ClickTale_Logger::getFullPath()</b><br>
<?php 
echo ClickTale_Logger::getFullPath();
?>
<br>
<b>Latest log</b><br>
<div style="border: solid;"><?php 
echo nl2br(ClickTale_Logger::Read());
?>
</div>

<b>ClickTale_CheckCookieFlagForRecording()</b><br><?php 
echo ClickTale_CheckCookieFlagForRecording();
?>
<br>

<b>ClickTale_IsAllowedIp()</b><br><?php 
echo ClickTale_IsAllowedIp();
?>
<br>

<b>Default cache provider configuration</b><br>
<div style="border: solid;"><pre><?php 
print_r(ClickTale_Settings::Instance()->getCacheProviderConfig());
?>
</pre</div>
Esempio n. 3
0
 */
/*
 * This page retrieves the cached page from cache using the provided token
 */
header("X-Robots-Tag: noindex, nofollow", true);
if (!defined('ClickTale_Root')) {
    $pathinfo = pathinfo(__FILE__);
    define("ClickTale_Root", $pathinfo["dirname"]);
}
require_once ClickTale_Root . "/ClickTale.inc.php";
require_once ClickTale_Root . "/ClickTale.CacheFactory.php";
require_once ClickTale_Root . "/ClickTale.Settings.php";
require_once ClickTale_Root . "/ClickTale.Logger.php";
@($token = $_GET["t"]);
@($tok = substr($token, strlen($token) - 4));
if ($token != "CacheTest" && ClickTale_IsAllowedIp() == false) {
    $message = "Request from unauthorized ip: " . $_SERVER["REMOTE_ADDR"] . ", user agent: " . $_SERVER["HTTP_USER_AGENT"] . ".";
    ClickTale_Logger::Write($message);
    header("HTTP/1.0 403 " . $message);
    header("X-ClickTale-Fetcher:no-store");
    die("Request from unauthorized ip.");
}
try {
    $cacheProvider = ClickTale_CacheFactory::DefaultCacheProvider();
} catch (Exception $ex) {
    ClickTale_Logger::Write($ex->getMessage());
    header("X-ClickTale-Fetcher:no-store");
    header("HTTP/1.0 500 " . $ex->getMessage());
    die($ex->getMessage());
}
$config = ClickTale_Settings::Instance()->getCacheProviderConfig();