Skip to content

Commit fd95b9b

Browse files
author
Marius Burkard
committed
- added fix to manual backup action
1 parent 48934fb commit fd95b9b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

interface/lib/classes/plugin_backuplist.inc.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,22 @@ protected function makeBackup(&$message, &$error, $wb)
5656
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = ? AND action_param = ?";
5757
$tmp = $app->db->queryOneRecord($sql, $action_type, $domain_id);
5858
if ($tmp['number'] == 0) {
59-
$server_id = $this->form->dataRecord['server_id'];
59+
if($action_type === 'backup_database') {
60+
// get all server ids of databases for this domain
61+
$sql = 'SELECT `server_id` FROM `web_database` WHERE `parent_domain_id` = ?';
62+
$result = $app->db->query($sql, $domain_id);
63+
while(($cur = $result->get())) {
64+
$server_id = $cur['server_id'];
65+
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) VALUES (?, UNIX_TIMESTAMP(), ?, ?, 'pending', '')";
66+
$app->db->query($sql, $server_id, $action_type, $domain_id);
67+
}
68+
$result->free();
69+
} else {
70+
$server_id = $this->form->dataRecord['server_id'];
71+
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) VALUES (?, UNIX_TIMESTAMP(), ?, ?, 'pending', '')";
72+
$app->db->query($sql, $server_id, $action_type, $domain_id);
73+
}
6074
$message .= $wb['backup_info_txt'];
61-
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) VALUES (?, UNIX_TIMESTAMP(), ?, ?, 'pending', '')";
62-
$app->db->query($sql, $server_id, $action_type, $domain_id);
6375
} else {
6476
$error .= $wb['backup_pending_txt'];
6577
}
@@ -193,10 +205,10 @@ function onShow() {
193205
$rec['backup_encrypted'] = empty($rec['backup_password']) ? $wb["no_txt"] : $wb["yes_txt"];
194206
$backup_manual_prefix = 'manual-';
195207
$rec['backup_job'] = (substr($rec['filename'], 0, strlen($backup_manual_prefix)) == $backup_manual_prefix) ? $wb["backup_job_manual_txt"] : $wb["backup_job_auto_txt"];
196-
208+
197209
$rec['download_available'] = true;
198210
if($rec['server_id'] != $web['server_id']) $rec['download_available'] = false;
199-
211+
200212
if($rec['filesize'] > 0){
201213
$rec['filesize'] = $app->functions->currency_format($rec['filesize']/(1024*1024), 'client').' MB';
202214
}

0 commit comments

Comments
 (0)