<?php
if(!(is_readable(realpath(dirname(__FILE__))."/loginroutines.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__))."/loginroutines.inc");
} else {
	include_once(realpath(dirname(__FILE__))."/loginroutines.inc");
}

if(!(is_readable(realpath(dirname(__FILE__))."/db/mysqlroutines.common.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__))."/db/mysqlroutines.common.inc");
} else {
	include_once(realpath(dirname(__FILE__))."/db/mysqlroutines.common.inc");
}

if(!(is_readable(realpath(dirname(__FILE__))."/translate.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__))."/translate.inc");
} else {
	include_once(realpath(dirname(__FILE__))."/translate.inc");
}

if(!(is_readable(realpath(dirname(__FILE__))."/content.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__))."/content.inc");
} else {
	include_once(realpath(dirname(__FILE__))."/content.inc");
}


function checkValidAgentIP(){

	$lng = ( isset($_REQUEST['lang']) ? 'lang='.$_REQUEST['lang'] : '');

	$ip = $_SERVER['REMOTE_ADDR'];
	if(isset($_SERVER['HTTP_X_REAL_IP'])) {
		$ip = $_SERVER['HTTP_X_REAL_IP'];
	}

	$ippool = explode(",",getSetting('service','ippool',''));
	if ((!in_array($ip,$ippool)) && (1==2)) {
		header("Location: ".substr(getCurPageURLWO(), 0, -8)."/pagenotfound.php?".$lng."url=".getCurPageWithEncodeParams());
		ob_end_flush();
		exit;
	}
}
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Pragma: no-cache");
?>
