Exemplo n.º 1
0
function versionInUpdate($current_version, $version_to_check)
{
    if (!isFroxlor()) {
        return true;
    }
    return version_compare2($current_version, $version_to_check) == -1 ? true : false;
}
Exemplo n.º 2
0
function versionInUpdate($current_version, $version_to_check)
{
    if (!isFroxlor()) {
        return true;
    }
    $pos_a = strpos($current_version, '-svn');
    $pos_b = strpos($version_to_check, '-svn');
    // if we compare svn-versions, we have to add -svn0 to the version
    // to compare it correctly
    if ($pos_a === false && $pos_b !== false) {
        $current_version .= '-svn9999';
    }
    return version_compare($current_version, $version_to_check, '<');
}
Exemplo n.º 3
0
 * @copyright  (c) the authors
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if ($page == 'overview') {
    $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
    /**
     * this is a dirty hack but syscp 1.4.2.1 does not
     * have any version/dbversion in the database (don't know why)
     * so we have to set them both to run a correct upgrade
     */
    if (!isFroxlor()) {
        if (Settings::Get('panel.version') == null || Settings::Get('panel.version') == '') {
            Settings::Set('panel.version', '1.4.2.1');
        }
        if (Settings::Get('system.dbversion') == null || Settings::Get('system.dbversion') == '') {
            /**
             * for syscp-stable (1.4.2.1) this value has to be 0
             * so the required table-fields are added correctly
             * and the svn-version has its value in the database
             * -> bug #54
             */
            $result_stmt = Database::query("\n\t\t\t\tSELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'");
            $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
            if (isset($result['value'])) {
                Settings::Set('system.dbversion', (int) $result['value'], false);
            } else {
Exemplo n.º 4
0
try {
    $filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------');
} catch (Exception $e) {
    standard_error('exception', $e->getMessage());
}
/*
 * since froxlor, we have to check if there's still someone
 * out there using syscp and needs to upgrade
 */
if (!isFroxlor()) {
    /**
     * Upgrading SysCP to Froxlor-0.9
     */
    include_once makeCorrectFile(dirname(__FILE__) . '/updates/froxlor/upgrade_syscp.inc.php');
}
if (isFroxlor()) {
    include_once makeCorrectFile(dirname(__FILE__) . '/updates/froxlor/0.9/update_0.9.inc.php');
    // Check Froxlor - database integrity (only happens after all updates are done, so we know the db-layout is okay)
    showUpdateStep("Checking database integrity");
    $integrity = new IntegrityCheck();
    if (!$integrity->checkAll()) {
        lastStepStatus(2, 'Monkeys ate the integrity');
        showUpdateStep("Trying to remove monkeys, feeding bananas");
        if (!$integrity->fixAll()) {
            lastStepStatus(2, 'Some monkeys just would not move');
        } else {
            lastStepStatus(0);
        }
    } else {
        lastStepStatus(0);
    }