error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
ini_set('memory_limit', '256M');
ini_set('max_execution_time', '180');
ini_set('max_input_time', '180');
// ini_set('mbstring.func_overload', '0');
// echo ini_get('mbstring.func_overload');
session_set_cookie_params(60*60*24*240);
include_once("controller/Controller.php"); // this is the initializer (if I could say so) for the controller part of our MVC pattern
include_once("controller/Controller_portal.php"); // this is the initializer (if I could say so) for the controller part of our MVC pattern
// echo getrootdirsrv()."
";
chdir(getrootdirsrv());
if (strpos(" ".$_SERVER['REQUEST_URI'], "/img%5C")) {
$fname = str_replace("%5C/", "/", $_SERVER['REQUEST_URI']);
// echo get_file_extension($fname)."
";
$f = file_get_contents(substr(getrootdirsrv(),0,-1).$fname);
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Disposition: attachment; filename=".substr($fname, strrpos($fname, "/")+1));
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strlen($f));
echo $f;
die;
}
if (strpos(" ".$_SERVER['REQUEST_URI'], "tick.png")) {
die;
}
if (strpos(" ".$_SERVER['REQUEST_URI'], "/data/users/")) {
$img = substr(getrootdirsrv(),0,-1).$_SERVER['REQUEST_URI'];
$pos = strpos($img, "?");
if ($pos) {
$img = substr($img,0,$pos);
$pos = strpos($img, "_");
$pos2 = strrpos($img, ".");
if ($pos && $pos2) {
$img = substr($img,0,$pos)."_nouser_".substr($img,$pos2);
}
}
// echo $img;
if (file_exists($img)) {
$f = file_get_contents($img);
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Disposition: attachment; filename=".substr($img, strrpos($img, "/")+1));
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strlen($f));
echo $f;
}
die;
}
// $logrecord = date("Y-m-d H:i:s")." ".$_QUERY[]
// aer ($_SERVER);
if ($_SERVER['REMOTE_ADDR']=='88.198.221.227') {
// die();
}
// aer ($_REQUEST);
// aer (json_encode($_REQUEST));
// die();
$fields = array();
$fields['CONTENT_LENGTH'] = 1;
$fields['SCRIPT_NAME'] = 1;
$fields['REQUEST_URI'] = 1;
$fields['QUERY_STRING'] = 1;
$fields['REQUEST_METHOD'] = 1;
$fields['CONTENT_LENGTH'] = 1;
$fields['REMOTE_PORT'] = 1;
$fields['REMOTE_ADDR'] = 1;
$fields['SERVER_PORT'] = 1;
$fields['SERVER_NAME'] = 1;
$fields['HTTP_COOKIE'] = 1;
$fields['REQUEST_TIME_FLOAT'] = 1;
$fields['HTTP_REFERER'] = 1;
$fields['REQUEST_SCHEME'] = 1;
$itm = new stdClass;
$itm->Request = (object)$_REQUEST;
// $itm->Server = (object)$_SERVER;
// $itm->Server = array();
// aer ($_SERVER);
foreach ($fields as $k=>$v) {
if ($v) {
// $itm->Server[$k] = $_SERVER[$k];
$itm->$k = $_SERVER[$k];
}
}
if (!$itm->HTTP_X_FORWARDED_PROTO) $itm->HTTP_X_FORWARDED_PROTO="HTTP";
$r = json_encode($itm);
addtologEx($r, 'access.log', 'logs'); // write to log in case of errors
$log=getFromCache('access');
$log=$log.$r."\n";
setCache('access', $log);
// aer ($_REQUEST);
// echo $_SERVER['REQUEST_URI']."
";
$page = $_REQUEST['cat'];
if ($_REQUEST['go'] || $_REQUEST['action'] || $_REQUEST['ekey']) {
$controller = new Controller(); // instantiate a class
$controller->run(); // start it. nice, isn't it?
} else {
$controller = new Controller_portal(); // instantiate a class
$controller->run(); // start it. nice, isn't it?
}
// $r = json_encode($_REQUEST);
$log=getFromCache('access');
$count = 1;
$log = str_replace($r."\n", "", $log, $count);
setCache('access', $log);
/*
$itm->UserID = getsecurevariable('userid');
$itm->TimeElapsed = formatmicrotime(microtime(true)-$thisstart);
$r = json_encode($itm);
addtologEx($r, 'access-timings.log', 'logs'); // write to log in case of errors
*/
//echo_r ($_SERVER);
?>