Commit 8938c852 authored by Marius Cramer's avatar Marius Cramer
Browse files

Merge branch 'master' into 'master'

Master

Added possibility to delete backups manually

See merge request !246
parents a5714c39 aa365c41
......@@ -85,8 +85,8 @@ class plugin_backuplist extends plugin_base {
$server_id = $this->form->dataRecord['server_id'];
$backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id);
if($backup['server_id'] > 0) $server_id = $backup['server_id'];
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = '$backup_id'";
$tmp = $app->db->queryOneRecord($sql);
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = ?";
$tmp = $app->db->queryOneRecord($sql, $backup_id);
if($tmp['number'] == 0) {
$message .= $wb['restore_info_txt'];
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
......@@ -96,6 +96,21 @@ class plugin_backuplist extends plugin_base {
$error .= $wb['restore_pending_txt'];
}
}
if($_GET['backup_action'] == 'delete' && $backup_id > 0) {
$server_id = $this->form->dataRecord['server_id'];
$backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id);
if($backup['server_id'] > 0) $server_id = $backup['server_id'];
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_delete' AND action_param = ?";
$tmp = $app->db->queryOneRecord($sql, $backup_id);
if($tmp['number'] == 0) {
$message .= $wb['delete_info_txt'];
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (?, UNIX_TIMESTAMP(), 'backup_delete', ?, 'pending', '')";
$app->db->query($sql, $server_id, $backup_id);
} else {
$error .= $wb['delete_pending_txt'];
}
}
}
......
......@@ -62,11 +62,24 @@ class plugin_backuplist_mail extends plugin_base {
if($tmp['number'] == 0) {
$message .= $wb['restore_info_txt'];
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (?, ? 'backup_restore_mail', ?, 'pending','')";
"VALUES (?, ?, 'backup_restore_mail', ?, 'pending','')";
$app->db->query($sql, $this->form->dataRecord['server_id'], time(), $backup_id);
} else {
$error .= $wb['restore_pending_txt'];
}
}
if($_GET['backup_action'] == 'delete_mail' && $backup_id > 0) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_delete_mail' AND action_param = '$backup_id'";
$tmp = $app->db->queryOneRecord($sql);
if($tmp['number'] == 0) {
$message .= $wb['delete_info_txt'];
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (?, ?, 'backup_delete_mail, ?, 'pending', '')";
$app->db->query($sql, $this->form->dataRecord['server_id'], time(), $backup_id);
} else {
$error .= $wb['delete_pending_txt'];
}
}
}
......
......@@ -357,7 +357,7 @@ class remoting_mail extends remoting {
return false;
}
if (/*$action_type != 'backup_download_mail' and*/ $action_type != 'backup_restore_mail') {
if (/*$action_type != 'backup_download_mail' and*/ $action_type != 'backup_restore_mail' and $action_type != 'backup_delete_mail') {
$this->server->fault('invalid_action', "Invalid action_type $action_type");
return false;
}
......
......@@ -931,7 +931,7 @@ class remoting_sites extends remoting {
return false;
}
if ($action_type != 'backup_download' and $action_type != 'backup_restore') {
if ($action_type != 'backup_download' and $action_type != 'backup_restore' and $action_type != 'backup_delete') {
$this->server->fault('invalid_action', "Invalid action_type $action_type");
return false;
}
......
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
......@@ -8,5 +8,9 @@ $wb['restore_info_txt'] = 'Restore of the backup has been started. This action t
$wb['restore_confirm_txt'] = 'Restoring may overwrite existing files in your mailbox. Do you really want to restore this backup?';
$wb['download_pending_txt'] = 'There is already a pending backup download job.';
$wb['restore_pending_txt'] = 'There is already a pending backup restore job.';
$wb['delete_backup_txt'] = 'Delete Backup';
$wb['delete_info_txt'] = 'Delete of the backup has been started. This action takes several minutes to be completed.';
$wb['delete_confirm_txt'] = 'Really delete this backup?';
$wb['delete_pending_txt'] = 'There is already a pending backup delete job.';
$wb['filesize_txt'] = 'Filesize';
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment