Exemple #1
0
}
if (!isset($_SESSION["uid"])) {
    writelogs("uid=" . $_SESSION["uid"] . " come back to logon", __FUNCTION__, __FILE__);
    header('location:logon.php');
    exit;
}
if (isset($_GET["GeoipCity"])) {
    GeoipCity();
    exit;
}
if (isset($_GET["PostfixStatus"])) {
    echo Artica_infos();
    exit;
}
if (isset($_GET["today"])) {
    echo GetToday();
    exit;
}
if (isset($_GET["lastinfos"])) {
    echo GetLastInfos();
    exit;
}
if (isset($_GET["allstatus"])) {
    echo PAGE_REFRESH_All_Status();
    exit;
}
if (isset($_GET["StartPostfix"])) {
    echo StartPostfix();
    exit;
}
if (isset($_GET["PostfixHistoryMsgID"])) {
    die;
}
$sock = new sockets();
$SQUIDEnable = $sock->GET_INFO("SQUIDEnable");
if ($SQUIDEnable == null) {
    $SQUIDEnable = 1;
}
if ($SQUIDEnable == 0) {
    die;
}
if (preg_match("#--verbose#", implode(" ", $argv))) {
    $GLOBALS["VERBOSE"] = true;
}
writelogs("Start running statistics for dansGuardian", basename(__FILE__), __FILE__, __LINE__);
$sql = "SELECT sitename,country,uri,uid,remote_ip,CLIENT,TYPE,REASON,DATE_FORMAT(zDate,'%H:%i:%s') as tdate,QuerySize FROM dansguardian_events ORDER BY zDate DESC LIMIT 0,100";
$html = GetToday() . "\n<div style='width:100%;height:300px;overflow:auto'>\n<table style='width:100%'>";
$q = new mysql();
writelogs("running master query", __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql, "artica_events");
if (!$q->ok) {
    die("Wrong query");
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
    $count = $count + 1;
    $Country = $ligne["country"];
    $country_img = GetFlags($Country);
    if ($ligne["TYPE"] == null) {
        $ligne["TYPE"] = "PASS";
    }
    if (preg_match("#EXCEPTION#", $ligne["TYPE"])) {
        $ligne["TYPE"] = "PASS";