function interface_error()
{
    $ini = new Bs_IniHandler();
    if (!is_file("/usr/share/artica-postfix/ressources/logs/interface.events")) {
        return null;
    }
    $ini->loadFile("/usr/share/artica-postfix/ressources/logs/interface.events");
    while (list($num, $ligne) = each($ini->_params)) {
        if ($ini->_params[$num]["error"] == null) {
            continue;
        }
        $html = $html . NotifyAdmin("warning64.png", "{error} {$num}", $ini->_params[$num]["error"], "javascript:StopInterfaceError('{$num}')");
    }
    events(__FUNCTION__ . "() done..");
    return $html;
}
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $cachePage = dirname(__FILE__) . "/ressources/logs/web/" . basename(__FILE__) . "." . __FUNCTION__;
    if (!$GLOBALS["AS_ROOT"]) {
        if (is_file($cachePage)) {
            $data = file_get_contents($cachePage);
            if (strlen($data) > 45) {
                echo $tpl->_ENGINE_parse_body($data) . "<script>UnlockPage();</script>";
                return;
            }
        }
    }
    $sock = new sockets();
    $datas = base64_decode($sock->getFrameWork("status.php?cpu-check-nx=yes"));
    if ($datas != null) {
        NotifyAdmin("system-32.png", "CPU Infos !", $datas, null);
    }
    if (is_file("ressources/logs/INTERNET_FAILED")) {
        NotifyAdmin("domain-whitelist-32.png", "{INTERNET_FAILED}", "{INTERNET_FAILED_TEXT}\n" . @file_get_contents("ressources/logs/INTERNET_FAILED"), null);
    }
    $left_menus_services_js = "";
    if (is_file("/usr/share/artica-postfix/ressources/logs/web/admin.index.status-infos.php.left_menus_actions")) {
        $left_menus_actions = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.status-infos.php.left_menus_actions");
    }
    if (is_file("/usr/share/artica-postfix/ressources/logs/web/admin.index.status-infos.php.left_menus_services")) {
        $left_menus_services = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.status-infos.php.left_menus_services");
    }
    $services_next = $tpl->_ENGINE_parse_body("\n<div style='font-size:16px;color:white' id='services-title'>\n\tServices:\n</div>\n<div id='left-menus-services'>{$left_menus_services}</div>\n<div id='left-menus-actions'>{$left_menus_actions}</div>\n\n<script>\n\tvar content=document.getElementById('left-menus-services').innerHTML;\n\tif(content.length<5){\n\t\tLoadAjaxWhite('left-menus-services','{$page}?left-menus-services=yes');\n\t}\n\t\n</script>");
    $q = new mysql();
    $sql = "DELETE FROM adminevents WHERE `text`='{websites_not_categorized_text}'";
    $q->QUERY_SQL($sql, "artica_events");
    $sql = "SELECT * FROM adminevents WHERE enabled=1 ORDER BY zDate DESC LIMIT 0,50";
    $results = $q->QUERY_SQL($sql, "artica_events");
    $html = "<table style='width:99%' class=form><tbody>";
    $c = 0;
    $f = squid_filters_infos();
    if (is_array($f)) {
        while (list($num, $ligne) = each($f)) {
            $c++;
            if ($ligne["subject"] == null) {
                continue;
            }
            $ligne["subject"] = $tpl->_ENGINE_parse_body($ligne["subject"]);
            $strlen = strlen($ligne["subject"]);
            $org_text = $ligne["subject"];
            if ($strlen > 25) {
                $text = substr($ligne["subject"], 0, 21) . "...";
            } else {
                $text = $org_text;
            }
            $html = $html . "\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/{$ligne["icon"]}'></td>\n\t\t\t\t<td style='font-size:11px' nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:{$ligne["js"]}\" style='font-size:11px;text-decoration:underline'>{$text}</a></td>\n\t\t\t</tr>\n\t\t\t";
        }
    }
    if (mysql_num_rows($results) == 0) {
        if ($c == 0) {
            if ($GLOBALS["AS_ROOT"]) {
                @mkdir(dirname($cachePage), 0777, true);
                @file_put_contents($cachePage, $html);
                @chmod($cachePage, 0777);
                return;
            }
            echo $services_next;
            return;
        }
        $html = $html . "</tbody></table><hr>{$services_next}<script>UnlockPage();</script>";
        if ($GLOBALS["AS_ROOT"]) {
            @mkdir(dirname($cachePage), 0777, true);
            @file_put_contents($cachePage, $html);
            @chmod($cachePage, 0777);
            return;
        }
        echo $html;
        return;
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($ligne["icon"] == "danger64.png") {
            $ligne["icon"] = "danger32.png";
        }
        if ($ligne["icon"] == "warning64.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "pluswarning64.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "danger32.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "license-error-64.png") {
            $ligne["icon"] = "license-error-32.png";
        }
        $ligne["subject"] = $tpl->_ENGINE_parse_body($ligne["subject"]);
        $strlen = strlen($ligne["subject"]);
        $org_text = $ligne["subject"];
        $text = $org_text;
        $text = texttooltip($text, $org_text, "Loadjs('{$page}?showInfos={$ligne["zmd5"]}')", null, 0, "font-size:11px;text-decoration:underline");
        $html = $html . "\n\t<tr>\n\t\t<td width=1%><img src='img/{$ligne["icon"]}'></td>\n\t\t<td style='font-size:11px' nowrap>{$text}</td>\n\t</tr>\n\t";
    }
    if ($GLOBALS["AS_ROOT"]) {
        $time = date("H:i:s");
        $html = $html . "\n\t\t<tr>\n\t\t<td width=1% colspan=2 style='font-size:11px;text-align:right'>{$time}</td>\n\t\t</tr>";
    }
    $html = $html . "</tbody></table>\n\n<div style='width:100%;text-align:right'>" . imgtootltip("20-refresh.png", "{refresh}", "LoadAjaxWhite('admin-left-infos','admin.index.status-infos.php');") . "</div>\n<hr>\n{$services_next}\n\n\n";
    if ($GLOBALS["AS_ROOT"]) {
        @mkdir(dirname($cachePage), 0777, true);
        @file_put_contents($cachePage, $html);
        @chmod($cachePage, 0777);
        return;
    }
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 3
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $datas = base64_decode($sock->getFrameWork("status.php?cpu-check-nx=yes"));
    if ($datas != null) {
        NotifyAdmin("system-32.png", "CPU Infos !", $datas, null);
    }
    if (is_file("ressources/logs/INTERNET_FAILED")) {
        NotifyAdmin("domain-whitelist-32.png", "{INTERNET_FAILED}", "{INTERNET_FAILED_TEXT}\n" . @file_get_contents("ressources/logs/INTERNET_FAILED"), null);
    }
    $services_next = $tpl->_ENGINE_parse_body("\n<div style='font-size:16px'>{services}:</div>\n<div id='left-menus-services'></div>\n\n<script>\n\tLoadAjax('left-menus-services','{$page}?left-menus-services=yes');\n</script>");
    $q = new mysql();
    $sql = "DELETE FROM adminevents WHERE `text`='{websites_not_categorized_text}'";
    $q->QUERY_SQL($sql, "artica_events");
    $sql = "SELECT * FROM adminevents WHERE enabled=1 ORDER BY zDate DESC LIMIT 0,50";
    $results = $q->QUERY_SQL($sql, "artica_events");
    $html = "<table style='width:100%' class=form><tbody>";
    $c = 0;
    $f = squid_filters_infos();
    if (is_array($f)) {
        while (list($num, $ligne) = each($f)) {
            $c++;
            if ($ligne["subject"] == null) {
                continue;
            }
            $ligne["subject"] = $tpl->_ENGINE_parse_body($ligne["subject"]);
            $strlen = strlen($ligne["subject"]);
            $org_text = $ligne["subject"];
            if ($strlen > 25) {
                $text = substr($ligne["subject"], 0, 21) . "...";
            } else {
                $text = $org_text;
            }
            $html = $html . "\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/{$ligne["icon"]}'></td>\n\t\t\t\t<td style='font-size:11px' nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:{$ligne["js"]}\" style='font-size:11px;text-decoration:underline'>{$text}</a></td>\n\t\t\t</tr>\n\t\t\t";
        }
    }
    if (mysql_num_rows($results) == 0) {
        if ($c == 0) {
            echo $services_next;
            return;
        }
        $html = $html . "</tbody></table><hr>{$services_next}";
        echo $html;
        return;
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($ligne["icon"] == "danger64.png") {
            $ligne["icon"] = "danger32.png";
        }
        if ($ligne["icon"] == "warning64.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "pluswarning64.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "danger32.png") {
            $ligne["icon"] = "warning-panneau-32.png";
        }
        if ($ligne["icon"] == "license-error-64.png") {
            $ligne["icon"] = "license-error-32.png";
        }
        $ligne["subject"] = $tpl->_ENGINE_parse_body($ligne["subject"]);
        $strlen = strlen($ligne["subject"]);
        $org_text = $ligne["subject"];
        if ($strlen > 25) {
            $text = substr($ligne["subject"], 0, 21) . "...";
        } else {
            $text = $org_text;
        }
        $text = texttooltip($text, $org_text, "Loadjs('{$page}?showInfos={$ligne["zmd5"]}')", null, 0, "font-size:11px;text-decoration:underline");
        $html = $html . "\n\t<tr>\n\t\t<td width=1%><img src='img/{$ligne["icon"]}'></td>\n\t\t<td style='font-size:11px' nowrap>{$text}</td>\n\t</tr>\n\t";
    }
    $html = $html . "</tbody></table>\n<div style='width:100%;text-align:right'>" . imgtootltip("20-refresh.png", "{refresh}", "LoadAjax('admin-left-infos','admin.index.status-infos.php');") . "</div>\n<hr>\n{$services_next}\n\n\n";
    echo $tpl->_ENGINE_parse_body($html);
}