- fix update from syscp-trunk (current rev 2739), fixes #27

This commit is contained in:
Michael Kaufmann (d00p)
2010-02-23 13:24:56 +00:00
parent dd9b72e45e
commit fea80269ed
2 changed files with 28 additions and 12 deletions

View File

@@ -22,6 +22,22 @@ 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
* has any version/dbversion in the database (don't know why)
* so we have to set them both to run a correct upgrade
*/
if (!isset($settings['panel']['version'])
|| $settings['panel']['version'] == ''
) {
$settings['panel']['version'] = '1.4.2.1';
}
if (!isset($settings['system']['dbversion'])
|| $settings['system']['dbversion'] == ''
) {
$settings['system']['dbversion'] = 2;
}
if(hasUpdates($version))
{
if(isset($_POST['send'])

View File

@@ -20,13 +20,13 @@ if(isFroxlorVersion('0.9-r0'))
showUpdateStep("Updating from 0.9-r0 to 0.9-r1", false);
showUpdateStep("Performing database updates");
/*
* add missing database-updates if necessary (old: update/update_database.php
* add missing database-updates if necessary (old: update/update_database.php)
*/
if(!isset($settings['system']['dbversion']) || $settings['system']['dbversion'] < '1')
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 1)
{
$db->query("ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';");
}
if(!isset($settings['system']['dbversion']) || $settings['system']['dbversion'] < '2')
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2)
{
$db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,