function popup()
{
    $tpl = new templates();
    if (is_file("ressources/logs/global.status.ini")) {
        $ini = new Bs_IniHandler("ressources/logs/global.status.ini");
    } else {
        writelogs("ressources/logs/global.status.ini no such file");
        $sock = new sockets();
        $datas = base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
        $ini = new Bs_IniHandler($datas);
    }
    $sock = new sockets();
    $datas = $sock->getFrameWork('cmd.php?refresh-status=yes');
    $array = array_postfix_status();
    while (list($num, $ligne) = each($array)) {
        $st = DAEMON_STATUS_LINE($ligne, $ini, null, 1);
        if ($st == null) {
            continue;
        }
        $status = $status . $st . "\n";
    }
    echo $tpl->_ENGINE_parse_body($status);
}
Exemple #2
0
function bar_status()
{
    $page = CurrentPageName();
    $tpl = new templates();
    if (is_file("ressources/logs/global.status.ini")) {
        $ini = new Bs_IniHandler("ressources/logs/global.status.ini");
    } else {
        writelogs("ressources/logs/global.status.ini no such file");
        $sock = new sockets();
        $datas = base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
        $ini = new Bs_IniHandler($datas);
    }
    $c = 0;
    $array = $array = array_postfix_status();
    while (list($num, $DAEMON_NAME) = each($array)) {
        if (!DAEMON_STATUS_IS_OK($DAEMON_NAME, $ini)) {
            $c++;
        }
    }
    if ($c > 0) {
        $status = ParagrapheTEXT("warn-red-48.png", "{$c} {SERVICESS_STOPPED}", "{$c} {SERVICESS_STOPPED_TEXT}", "javascript:Loadjs('postfix.status.allservices.php')", 90);
    } else {
        $status = ParagrapheTEXT("ok42.png", "{SERVICESS_OK}", "{SERVICESS_OK_TEXT}", "javascript:Loadjs('postfix.status.allservices.php')", 90);
    }
    $main = new maincf_multi("master", "master");
    $freeze_delivery_queue = $main->GET('freeze_delivery_queue');
    if ($freeze_delivery_queue == 1) {
        $warn1 = ParagrapheTEXT("warn-red-48.png", "{WARN_QUEUE_FREEZE}", "{WARN_QUEUE_FREEZE}");
    }
    $main = new main_cf();
    $count = 0;
    while (list($num, $ligne) = each($main->array_mynetworks)) {
        if ($ligne == "127.0.0.0/8") {
            continue;
        }
        if ($ligne == "127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128") {
            continue;
        }
        $count++;
    }
    if ($count == 0) {
        $nonet = ParagrapheTEXT('warn-red-48.png', "{NO_POSTFIX_NETWORK_SET}", '{NO_POSTFIX_NETWORK_SET_EXPLAIN}', "javascript:Loadjs('postfix.network.php?ajax=yes')", 90);
    }
    return $tpl->_ENGINE_parse_body($status . $nonet . $refresh . $warn1);
}