From 5a99950a8f7fa0901de9e400939fe36ddffd820e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Wed, 7 Apr 2010 11:31:31 +0000 Subject: [PATCH] support for older Froxlor-versions in update-process (we had the awstats_path setting already in older releases), refs #120 --- install/updates/froxlor/0.9/update_0.9.inc.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index b72a2e8f..b77385f9 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -396,8 +396,22 @@ if(isFroxlorVersion('0.9.4')) { showUpdateStep("Updating from 0.9.4 to 0.9.4-svn1", false); - showUpdateStep("Adding new settings"); - $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');"); + /** + * some users might still have the setting in their database + * because we already had this back in older versions. + * To not confuse Froxlor, we just update old settings. + */ + if(isset($settings['system']['awstats_path']) + && $settings['system']['awstats_path'] != '' + ) { + showUpdateStep("Updating settings"); + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';"); + } + else + { + showUpdateStep("Adding new settings"); + $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');"); + } lastStepStatus(0); updateToVersion('0.9.4-svn1');