Commit 634132a0 authored by Dominik's avatar Dominik Committed by root
Browse files

Added possibility to delete backups

Conflicts:
	interface/lib/classes/remoting.inc.php
	interface/web/mail/templates/mail_user_backup_list.htm
	interface/web/sites/lib/lang/en_web_backup_list.lng
	interface/web/sites/lib/lang/es_web_backup_list.lng
	interface/web/sites/lib/lang/tr_web_backup_list.lng
	server/plugins-available/backup_plugin.inc.php
parent a5714c39
......@@ -96,6 +96,28 @@ 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 = '$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 (".
(int)$server_id . ", " .
time() . ", " .
"'backup_delete', " .
"'".$backup_id."', " .
"'pending', " .
"''" .
")";
$app->db->query($sql);
} else {
$error .= $wb['delete_pending_txt'];
}
}
}
......
......@@ -67,6 +67,26 @@ class plugin_backuplist_mail extends plugin_base {
} 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 (".
(int)$this->form->dataRecord['server_id'] . ", " .
time() . ", " .
"'backup_delete_mail', " .
"'".$backup_id."', " .
"'pending', " .
"''" .
")";
$app->db->query($sql);
} 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