Exemplo n.º 1
0
function mysql_main_switch()
{
    $tab = null;
    $users = new usersMenus();
    $sock = new sockets();
    $sock->getFrameWork('cmd.php?SetupCenter=yes');
    $GLOBALS["ArticaMetaDisableSetupCenter"] = $sock->GET_INFO("ArticaMetaDisableSetupCenter");
    if (!isset($_GET["refresh"])) {
        if ($_GET["main"] != "index") {
            echo "\n\t\t\t<input type='hidden' id='main_array_setup_install_selected' value='{$_GET["main"]}'>\n\t\t\t<div style='text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "InstallRefresh()") . "</div>\n\t\t\t<div id='main_array_setup_install_{$_GET["main"]}'>";
        }
    }
    switch ($_GET["main"]) {
        case "index":
            echo index();
            break;
        case "smtp_packages":
            echo $tab . smtp_packages();
            break;
        case "stat_packages":
            echo $tab . stat_packages();
            break;
        case "web_packages":
            echo $tab . web_packages();
            break;
        case "proxy_packages":
            echo $tab . proxy_packages();
            break;
        case "samba_packages":
            echo $tab . samba_packages();
            break;
        case "system_packages":
            echo $tab . system_packages();
            break;
        case "xapian_packages":
            echo $tab . xapian_packages();
            break;
        case "service_family":
            echo services_family();
            break;
        default:
            if ($users->POSTFIX_INSTALLED) {
                echo $tab . smtp_packages();
                exit;
            }
            if ($users->SQUID_INSTALLED) {
                echo $tab . proxy_packages();
                exit;
            }
            if ($users->SAMBA_INSTALLED) {
                echo $tab . samba_packages();
                exit;
            }
            echo $tab . system_packages();
            exit;
    }
    if (!isset($_GET["refresh"])) {
        echo "</div>";
    }
}
function setup_center()
{
    if (!$GLOBALS["FORCE"]) {
        if (!Build_pid_func(__FILE__, __FUNCTION__)) {
            return false;
        }
        $time_file = "/etc/artica-postfix/croned.2/" . md5(__FILE__ . __FUNCTION__);
        $tt = file_time_sec($time_file);
        if ($tt < 30) {
            events(__FUNCTION__ . " {$tt} seconds, please wait 30s");
            return null;
        }
    }
    include_once dirname(__FILE__) . '/setup.index.php';
    error_log("Starting " . __FUNCTION__ . " in " . __FILE__);
    BuildingExecStatus("Setup center:: statistics...", 52);
    stat_packages();
    BuildingExecStatus("Setup center:: SMTP...", 54);
    smtp_packages();
    BuildingExecStatus("Setup center:: WEB...", 56);
    web_packages();
    BuildingExecStatus("Setup center:: Proxy...", 58);
    proxy_packages();
    BuildingExecStatus("Setup center:: Samba...", 60);
    samba_packages();
    BuildingExecStatus("Setup center:: System...", 62);
    system_packages();
    BuildingExecStatus("Setup center:: Xapian...", 64);
    xapian_packages();
    BuildingExecStatus("Setup center:: done...", 68);
    events(__FUNCTION__ . "() done..");
}