33 lines
933 B
PHP
33 lines
933 B
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 27/gen/2016
|
|
*/
|
|
|
|
require_once(dirname(__FILE__)."/../load.php");
|
|
|
|
try {
|
|
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
|
|
if (strcmp($host,$_SERVER["HTTP_HOST"])==0){
|
|
$ip = PostHandler::get("ip");
|
|
$content = PostHandler::get("content");
|
|
$source = PostHandler::get("source");
|
|
if (!is_null($ip) && !is_null($content) && !is_null($source)){
|
|
AnalyticsHelper::savePageImpression($ip, $content, $source);
|
|
}
|
|
}
|
|
else {
|
|
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
}
|
|
}
|
|
else {
|
|
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
}
|
|
}
|
|
catch (Exception $ex){
|
|
echo $ex->getMessage();
|
|
}
|
|
|
|
?>
|