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 6c1efccc..5a1405f5 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -1733,6 +1733,27 @@ if(isFroxlorVersion('0.9.25')) // enable bind by default $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'bind_enable', '1')"); + // check for multiple backup_enabled entries + $handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `varname` = 'backup_enabled';"); + + // if there are more than one entry try to fix it + if ($db->num_rows($handle) > 1) { + $rows = $db->fetch_array($handle); + $state = false; + + // iterate through all found entries + // and try to guess what value it should be + foreach ($rows as $row) { + $state = $state | $row['value']; + } + + // now delete all entries + $db->query("DELETE FROM `panel_settings` WHERE `varname` = 'backup_enabled';"); + + // and re-add it + $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'backup_enabled', '". $state ."');"); + } + updateToVersion('0.9.26-rc1'); }