include_once dirname(__FILE__) . '/ressources/class.main_cf.inc';
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
include_once dirname(__FILE__) . "/ressources/class.pdns.inc";
include_once dirname(__FILE__) . '/ressources/class.system.network.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
$usersmenus = new usersMenus();
if (!$usersmenus->AsProxyMonitor) {
    $tpl = new templates();
    header("content-type: application/javascript");
    $alert = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    echo "alert('{$alert}');";
    die;
}
if (isset($_GET["logger-status"])) {
    loggers_status();
    exit;
}
page();
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}"));
        return;
    }
    $t = time();
    $html = "<div style='font-size:26px;margin-bottom:20px'>{APP_LOGGERS}</div>\n\t<div style='font-size:16px' class=explain>{APP_LOGGERS_SQUID_EXPLAIN}</div>\n\t<div id='logger-status'></div>\n\t\n\t\t\t\n\t<script>\n\t\tfunction LoggerStatus{$t}(){\n\t\t\tLoadAjax('logger-status','{$page}?logger-status=yes',false);\n\t\t\n\t\t}\n\t\tLoggerStatus{$t}();\n\t</script>\n";
include_once(dirname(__FILE__) . "/ressources/class.sockets.inc");
include_once(dirname(__FILE__) . "/ressources/class.pdns.inc");
include_once(dirname(__FILE__) . '/ressources/class.system.network.inc');
include_once(dirname(__FILE__) . '/ressources/class.squid.inc');


$usersmenus=new usersMenus();
if(!$usersmenus->AsProxyMonitor){
	$tpl=new templates();
	header("content-type: application/javascript");
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "alert('$alert');";
	die();
}

if(isset($_GET["logger-status"])){loggers_status();exit;}
page();


function page(){
	$page=CurrentPageName();
	$tpl=new templates();
	
	$sock=new sockets();
	$SquidPerformance=intval($sock->GET_INFO("SquidPerformance"));
	if($SquidPerformance>1){
		echo $tpl->_ENGINE_parse_body(FATAL_WARNING_SHOW_128("{artica_statistics_disabled}"));
		return;
	}
	
	$t=time();