added cronjob-auto-update-feature (beware and READ), fixes #1342; remove old backup-ftp-users on update, fixes #1381

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-02-25 07:48:46 +01:00
parent e650be3814
commit d00cdec296
10 changed files with 103 additions and 21 deletions

View File

@@ -501,6 +501,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'mailtraffic_enabled', '1'),
('system', 'cronconfig', '/etc/cron.d/froxlor'),
('system', 'crondreload', '/etc/init.d/cron reload'),
('system', 'croncmdline', '/usr/bin/nice -n 5 /usr/bin/php5 -q'),
('system', 'cron_allowautoupdate', '0'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),
@@ -528,7 +530,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('panel', 'phpconfigs_hidestdsubdomain', '0'),
('panel', 'allow_theme_change_admin', '1'),
('panel', 'allow_theme_change_customer', '1'),
('panel', 'version', '0.9.32-rc1');
('panel', 'version', '0.9.32-rc2');
DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -275,7 +275,7 @@ class FroxlorInstall {
$navigation = '';
$msgcolor = 'red';
$message = $this->_lng['install']['testing_mysql_fail'];
$link = 'install.php';
$link = 'install.php?check=1';
$linktext = $this->_lng['click_here_to_goback'];
} else {
// all good

View File

@@ -2727,3 +2727,29 @@ if (isFroxlorVersion('0.9.32-dev6')) {
updateToVersion('0.9.32-rc1');
}
if (isFroxlorVersion('0.9.32-rc1')) {
showUpdateStep("Updating from 0.9.32-rc1 to 0.9.32-rc2", false);
showUpdateStep("Removing autoresponder-cronjob (deprecated)");
Database::query("DELETE FROM `".TABLE_PANEL_CRONRUNS."` WHERE `module` = 'froxlor/autoresponder';");
lastStepStatus(0);
showUpdateStep("Adding new settings for cron");
// get user-chosen value
$croncmdline = isset($_POST['croncmdline']) ? $_POST['croncmdline'] : "/usr/bin/nice -n 5 /usr/bin/php5 -q";
Settings::AddNew("system.croncmdline", $croncmdline);
// add task to generate cron.d-file
inserttask('99');
// silenty add the auto-update setting - we do not want everybody to know and use this
// as it is a very dangerous setting
Settings::AddNew("system.cron_allowautoupdate", 0);
lastStepStatus(0);
showUpdateStep("Removing backup-module ftp-users (deprecated)");
Database::query("DELETE FROM `".TABLE_FTP_USERS."` WHERE `username` LIKE '%_backup';");
lastStepStatus(0);
updateToVersion('0.9.32-rc2');
}

View File

@@ -650,4 +650,12 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if (versionInUpdate($current_version, '0.9.32-rc2')) {
$has_preconfig = true;
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
$question.= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}