Beispiel #1
0
function uninstallMain(&$s)
{
    global $dbName, $dbUser, $dbUserPw, $dbHost;
    $s = "";
    if (!isset($dbName)) {
        iPrint($s1, "err", $sp);
        $s .= $sp;
        $txt = "dbName not set";
        handleErr($txt, __FILE__, __LINE__);
    }
    showInstallHeader($s1);
    $s .= $s1;
    $s .= "<h1>Uninstall</h1>";
    connectDb($dbHost, $dbUser, $dbUserPw, $dbName);
    $query = "DROP DATABASE {$dbName}";
    $result = executeQuery($query);
    iPrint("Db dropped", "ok", $sp);
    $s .= $sp;
    iPrint("Uninstall successful", "hurra", $sp);
    $s .= $sp;
    return ok;
}
Beispiel #2
0
function updateMain(&$s)
{
    global $lll, $gorumuser, $submit, $noahVersions;
    global $dbName, $dbUser, $dbUserPw, $dbHost, $gorumrecognised;
    $gorumrecognised = $gorumuser->isAdm = TRUE;
    // az update-nek biztos ami biztos admin privilegiumokat kell adni
    $s = "";
    showInstallHeader($s1);
    $s .= $s1;
    $s .= "<h1>" . $lll["u_maintitle"] . "</h1>\n";
    connectDb($dbHost, $dbUser, $dbUserPw, $dbName);
    if (G::load($fgs, 1, "globalstat")) {
        iPrint($lll["cantGetVersionInfo"], "err", $sp);
        $s .= $sp;
    }
    $toVersion = $noahVersions[sizeof($noahVersions) - 1];
    if (isset($_GET["submit"])) {
        $submit = $_GET["submit"];
    }
    if (!isset($submit)) {
        if ($fgs->instver == $toVersion) {
            iPrint(sprintf($lll["already_installed"], $toVersion), "ok", $sp);
            $s .= $sp;
            return ok;
        }
        iPrint($lll["secure_copy"], "warn", $sp);
        $s .= $sp;
        $s .= "<br><br>";
        iPrint(sprintf($lll["ready_to_update"], $dbName, $toVersion), "ok", $sp);
        $s .= $sp;
        $s .= "<form method='get' action='update.php'>\n";
        $s .= "<input type='submit' name='submit' value='" . $lll["continue"] . "'>";
        $s .= "</form>\n";
    } else {
        if ($submit == $lll["cancel"]) {
            iPrint($lll["operation_cancelled"], "ok", $sp);
            $s .= $sp;
        } else {
            if ($submit == $lll["continue"]) {
                if ($fgs->instver == "1_2" || $fgs->instver == "1_1") {
                    iPrint($lll["onlyFrom1.3"], "err", $sp);
                    $s .= $sp;
                } else {
                    if ($fgs->instver < "2_3_0") {
                        if (!is__writable(NOAH_APP)) {
                            iPrint(sprintf($lll["picturesDirMustbeWritable"], NOAH_APP), "err", $sp);
                            $s .= $sp;
                            return;
                        }
                    }
                    if ($fgs->instver == "1_3" || $fgs->instver == "1_3_1") {
                        if (!is__writable(AD_PIC_DIR)) {
                            iPrint(sprintf($lll["picturesDirMustbeWritable"], AD_PIC_DIR), "err", $sp);
                            $s .= $sp;
                            return;
                        }
                        update_1_3_to_2_1_2($s1, $dbName);
                        $s .= $s1;
                        $fgs->instver = "2.1.2";
                        $fgs->defPageConf = TRUE;
                        modify($fgs);
                    }
                    if ($fgs->instver != $toVersion) {
                        update($s1, $dbName, $fgs->instver, $toVersion);
                        $s .= $s1;
                    }
                    $ctrl =& new AppController("checkconf/show");
                    $s .= "<br><br><a href='" . $ctrl->makeURL() . "'>" . $lll["backToIndex"] . "</a>";
                }
            }
        }
    }
}