Пример #1
0
"/>
</head>
<body>
<?php 
$upgrade = new Upgrade();
if (GET('submit')) {
    $ok = $upgrade->needs_upgrade();
    if (!$ok) {
        echo ossim_error(_("No upgrades needed"), AV_INFO);
        exit;
    }
    if (ossim_error()) {
        echo ossim_error(_("Not clean installation detected. Refusing to apply upgrades, please do it manually"));
        exit;
    }
    $upgrade->apply_needed();
    echo "<br><br>\n    <form>\n        <table width='100%' class='noborder' style='background:transparent;'>\n            <tr>\n                <td class='nobborder' style='text-align:center;'>\n                    <input type='button' onclick=\"top.frames['main'].window.location.reload();\" value='" . _("Continue") . "'/>\n                </td>\n            </tr>\n        </table>\n    </form>";
    exit;
}
// Force a certain upgrade
if (GET('version') && GET('type') && GET('force')) {
    $upgrades = $upgrade->get_all();
    if (!isset($upgrades[$version])) {
        echo ossim_error(_("Error! No valid version upgrade"));
        exit;
    }
    switch ($type) {
        case 'php_pre':
            $file = $upgrades[$version]['php']['file'];
            $upgrade->create_php_upgrade_object($file, $version);
            // XXX Move that to the main class