add possibility to enable/disable backup function
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -525,6 +525,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'letsencryptkeysize', '4096'),
|
||||
('system', 'letsencryptreuseold', 0),
|
||||
('system', 'leenabled', '0'),
|
||||
('system', 'backupenabled', '0'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
|
||||
@@ -3295,7 +3295,9 @@ if (isFroxlorVersion('0.9.35')) {
|
||||
|
||||
if (isFroxlorVersion('0.9.35.1') && isDatabaseVersion('201603150')) {
|
||||
|
||||
showUpdateStep("Adding new backup-cron entry");
|
||||
showUpdateStep("Adding new backup settings and cron");
|
||||
$enable_backup = isset($_POST['enable_backup']) ? (int) $_POST['enable_backup'] : "0";
|
||||
Settings::AddNew("system.backupenabled", $enable_backup);
|
||||
$stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_CRONRUNS . "` SET
|
||||
`module` = 'froxlor/backup',
|
||||
@@ -3303,9 +3305,9 @@ if (isFroxlorVersion('0.9.35.1') && isDatabaseVersion('201603150')) {
|
||||
`interval` = '1 DAY',
|
||||
`desc_lng_key` = 'cron_backup',
|
||||
`lastrun` = 0,
|
||||
`isactive` = 0"
|
||||
`isactive` = :isactive"
|
||||
);
|
||||
Database::pexecute($stmt);
|
||||
Database::pexecute($stmt, array('isactive' => $enable_backup));
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201604270');
|
||||
|
||||
@@ -708,4 +708,12 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
|
||||
$question.= makeyesno('enable_letsencrypt', '1', '0', '1').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201604270')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to enable or disable our backup function.<br /><br />';
|
||||
$question = '<strong>Do you want to enable Backup? (default: no):</strong> ';
|
||||
$question.= makeyesno('enable_backup', '1', '0', '0').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user