Marius Cramer
2015-11-20 8938c852f00cbd4aa62772a2bafd528c71180772
Merge branch 'master' into 'master'

Master

Added possibility to delete backups manually

See merge request !246
51 files modified
362 ■■■■ changed files
interface/lib/classes/plugin_backuplist.inc.php 19 ●●●● patch | view | raw | blame | history
interface/lib/classes/plugin_backuplist_mail.inc.php 15 ●●●●● patch | view | raw | blame | history
interface/lib/classes/remote.d/mail.inc.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/remote.d/sites.inc.php 2 ●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/ar_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/bg_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/br_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/cz_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/de_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/el_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/en_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/es_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/fi_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/fr_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/hr_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/hu_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/id_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/it_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/ja_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/nl_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/ru_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/se_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/sk_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/tr_mail_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/mail/templates/mail_user_backup_list.htm 3 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/ar_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/bg_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/br_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/cz_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/el_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/es_web_backup_list.lng 5 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/fi_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/fr_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/hr_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/hu_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/id_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/it_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/ja_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/nl_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/pl_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/pt_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/ro_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/ru_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/se_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/sk_web_backup_list.lng 4 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/tr_web_backup_list.lng 6 ●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_backup_list.htm 1 ●●●● patch | view | raw | blame | history
server/lib/classes/cron.d/500-backup_mail.inc.php 14 ●●●●● patch | view | raw | blame | history
server/plugins-available/backup_plugin.inc.php 131 ●●●●● patch | view | raw | blame | history
interface/lib/classes/plugin_backuplist.inc.php
@@ -85,8 +85,8 @@
                $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 @@
                    $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'];
                }
            }
        }
interface/lib/classes/plugin_backuplist_mail.inc.php
@@ -62,11 +62,24 @@
                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'];
                }
            }                
        }
                
interface/lib/classes/remote.d/mail.inc.php
@@ -357,7 +357,7 @@
            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;
        }
interface/lib/classes/remote.d/sites.inc.php
@@ -931,7 +931,7 @@
            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;
        }
interface/web/mail/lib/lang/ar_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/bg_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/br_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/cz_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/de_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/el_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/en_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/es_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/fi_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/fr_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/hr_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/hu_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/id_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/it_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/ja_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/nl_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/ru_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/se_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/sk_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/lib/lang/tr_mail_backup_list.lng
@@ -8,5 +8,9 @@
$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';
?>
interface/web/mail/templates/mail_user_backup_list.htm
@@ -27,6 +27,7 @@
                            <td class="text-right">
                                <div class="buttons">
                                    <button class="btn btn-default formbutton-default" type="button" onclick="ISPConfig.confirm_action('mail/mail_user_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=restore_mail&backup_id={tmpl_var name='backup_id'}','{tmpl_var name='restore_confirm_txt'}');">{tmpl_var name="restore_backup_txt"}</button>
                                    <button class="btn btn-default formbutton-default" type="button" onclick="ISPConfig.confirm_action('mail/mail_user_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=delete_mail&backup_id={tmpl_var name='backup_id'}','{tmpl_var name='delete_confirm_txt'}');">{tmpl_var name="delete_backup_txt"}</button>
                                </div>
                            </td>
                        </tr>
@@ -38,4 +39,4 @@
                    </tmpl_unless>
                </tbody>
            </table>
</div>
</div>
interface/web/sites/lib/lang/ar_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/bg_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/br_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/cz_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Obnovení přepíše existující soubory na Vaší webové stránce. Opravdu chcete obnovit tuto zálohu ?';
$wb['download_pending_txt'] = 'Shodný požadavek na vytvoření zálohy pro stažení již čeká ve frontě na serveru ke zpracování.';
$wb['restore_pending_txt'] = 'Shodný požadavek na obnovu dat ze zálohy již čeká ve frontě na serveru ke zpracování.';
$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['backup_type_mysql'] = 'MySQL Databáze';
$wb['backup_type_web'] = 'Soubory webových stránek';
?>
interface/web/sites/lib/lang/de_web_backup_list.lng
@@ -11,6 +11,10 @@
$wb['backup_type_mongodb'] = 'MongoDB Datenbank';
$wb['download_pending_txt'] = 'Es liegt bereits ein Backup-Download-Job an.';
$wb['restore_pending_txt'] = 'Es liegt bereits ein Backup-Wiederherstellungs-Job an.';
$wb['delete_backup_txt'] = 'Backup löschen';
$wb['delete_info_txt'] = 'Das Löschen des Backups hat begonnen. Diese Aktion kann bis zur Fertigstellung einige Minuten dauern.';
$wb['delete_confirm_txt'] = 'Möchten Sie dieses Backup wirklich löschen?';
$wb['delete_pending_txt'] = 'Es liegt bereits ein Backup-Lösch-Job an.';
$wb['backup_type_mysql'] = 'MySQL-Datenbank';
$wb['backup_type_web'] = 'Webseiten-Dateien';
?>
interface/web/sites/lib/lang/el_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/en_web_backup_list.lng
@@ -11,6 +11,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mongodb'] = 'MongoDB Database';
$wb['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
interface/web/sites/lib/lang/es_web_backup_list.lng
@@ -1,4 +1,5 @@
<?php
<<<<<<< HEAD
$wb['list_head_txt'] = 'Respaldos existentes';
$wb['date_txt'] = 'Fecha';
$wb['backup_type_txt'] = 'Tipo';
@@ -10,6 +11,10 @@
$wb['restore_confirm_txt'] = 'La restauración sobreescribirá los archivos en el sitio web. Realmente desea restaurar este respaldo?';
$wb['download_pending_txt'] = 'Ya existe un trabajo pendiente para descarga de respaldo.';
$wb['restore_pending_txt'] = 'Ya existe un trabajo pendiente para restauración de respaldo.';
$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['backup_type_mysql'] = 'Base de datos MySQL';
$wb['backup_type_web'] = 'Archivos del sitio web';
?>
interface/web/sites/lib/lang/fi_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/fr_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/hr_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/hu_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/id_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/it_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/ja_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/nl_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/pl_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Przywrócenie danych z kopii zapasowej zastąpi wszystkie obecnie istniejące pliki. Czy na pewno chcesz to zrobić?';
$wb['download_pending_txt'] = 'Trwa już jedno zadanie pobrania kopii.';
$wb['restore_pending_txt'] = 'Trwa już jedno zadanie przywrócenia danych z kopii.';
$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['backup_type_mysql'] = 'Baza MySQL';
$wb['backup_type_web'] = 'Pliki strony';
?>
interface/web/sites/lib/lang/pt_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/ro_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/ru_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/se_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL-databaser';
$wb['backup_type_web'] = 'Webbsidefiler';
?>
interface/web/sites/lib/lang/sk_web_backup_list.lng
@@ -10,6 +10,10 @@
$wb['restore_confirm_txt'] = 'Restoring will overwrite existing files in your website. 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['backup_type_mysql'] = 'MySQL Database';
$wb['backup_type_web'] = 'Website files';
?>
interface/web/sites/lib/lang/tr_web_backup_list.lng
@@ -1,4 +1,5 @@
<?php
<<<<<<< HEAD
$wb['list_head_txt'] = 'Alınmış Yedekler';
$wb['date_txt'] = 'Tarih';
$wb['backup_type_txt'] = 'Tip';
@@ -11,6 +12,9 @@
$wb['download_pending_txt'] = 'Zaten bekleyen bir yedek indirme işlemi var.';
$wb['restore_pending_txt'] = 'Zaten bekleyen bir yedek geri yükleme işlemi var.';
$wb['backup_type_mysql'] = 'MySQL Veritabanı';
$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['backup_type_web'] = 'Web sitesi dosyaları';
?>
interface/web/sites/templates/web_backup_list.htm
@@ -32,6 +32,7 @@
                                    <tmpl_if name="download_available">
                                        <button class="btn btn-default formbutton-default" type="button" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=download&backup_id={tmpl_var name='backup_id'}">{tmpl_var name="download_backup_txt"}</button>
                                    </tmpl_if>
                                    <button class="button iconstxt icoDelete" type="button" onclick="confirm_action('sites/web_domain_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=delete&backup_id={tmpl_var name='backup_id'}','{tmpl_var name='delete_confirm_txt'}');"><span>{tmpl_var name="delete_backup_txt"}</span></button>
                                </div>
                            </td>
                        </tr>
server/lib/classes/cron.d/500-backup_mail.inc.php
@@ -219,6 +219,20 @@
                    }
                }
                // remove non-existing backups from database
                $backups = $app->db->queryAllRecords("SELECT * FROM mail_backup WHERE server_id = ?", $conf['server_id']);
                if(is_array($backups) && !empty($backups)){
                    foreach($backups as $backup){
                        $mail_backup_dir = $backup_dir.'/mail'.$rec['domain_id'];
                        $mail_backup_file = 'mail'.$rec['mailuser_id'].'_*';
                        if(!is_file($mail_backup_dir.'/'.$mail_backup_file)){
                            $sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?";
                            $app->db->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']);
                            if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
                        }
                    }
                }
                if( $server_config['backup_dir_is_mount'] == 'y' ) $app->system->umount_backup_dir($backup_dir);
                //* end run_backups
            }
server/plugins-available/backup_plugin.inc.php
@@ -53,9 +53,10 @@
        //* Register for actions
        $app->plugins->registerAction('backup_download', $this->plugin_name, 'backup_action');
        $app->plugins->registerAction('backup_restore', $this->plugin_name, 'backup_action');
        $app->plugins->registerAction('backup_delete', $this->plugin_name, 'backup_action');
        //$app->plugins->registerAction('backup_download_mail', $this->plugin_name, 'backup_action_mail');
        $app->plugins->registerAction('backup_restore_mail', $this->plugin_name, 'backup_action_mail');
        $app->plugins->registerAction('backup_delete_mail', $this->plugin_name, 'backup_action_mail');
    }
    //* Do a backup action
@@ -160,6 +161,18 @@
                    }
                    $app->system->web_folder_protection($web['document_root'], true);
                }
                if($action_name == 'backup_delete') {
                    if(file_exists($backup_dir.'/'.$backup['filename']) && !stristr($backup_dir.'/'.$backup['filename'], '..') && !stristr($backup_dir.'/'.$backup['filename'], 'etc')) {
                        unlink($backup_dir.'/'.$backup['filename']);
                        $sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?";
                        $app->db->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']);
                        if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
                        $app->log('unlink '.$backup_dir.'/'.$backup['filename'], LOGLEVEL_DEBUG);
                    }
                }
                if( $server_config['backup_dir_is_mount'] == 'y' ) $app->system->umount_backup_dir($backup_dir);
            } else {
                $app->log('Backup directory not ready.', LOGLEVEL_DEBUG);
@@ -178,14 +191,11 @@
        $backup_id = intval($data);
        $mail_backup = $app->dbmaster->queryOneRecord("SELECT * FROM mail_backup WHERE backup_id = ?", $backup_id);
    
        if (is_array($mail_backup) && $action_name == 'backup_restore_mail') {
        if (is_array($mail_backup)) {
            $app->uses('ini_parser,file,getconf');
    
            $server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
            $backup_dir = trim($server_config['backup_dir']);
            if($backup_dir == '') return;
            $backup_dir = $server_config['backup_dir'];
            $backup_dir_is_ready = true;
    
            //* mount backup directory, if necessary
@@ -217,65 +227,78 @@
                    chgrp($record['maildir'], $mail_config['mailuser_group']);
                }
            
                if(file_exists($mail_backup_file) && $record['homedir'] != '' && $record['homedir'] != '/' && !stristr($mail_backup_file,'..') && !stristr($mail_backup_file,'etc') && $mail_config['homedir_path'] == $record['homedir'] && is_dir($domain_dir) && is_dir($record['maildir'])) {
                    if ($record['maildir_format'] == 'mdbox') {
                        $retval = -1;
                        // First unzip backupfile to local backup-folder
                        if($mail_backup['backup_mode'] == 'userzip') {
                            copy($mail_backup_file, $record['maildir'].'/'.$mail_backup['filename']);
                            chgrp($record['maildir'].'/'.$mail_backup['filename'], $mail_config['mailuser_group']);
                            $command = 'sudo -u '.$mail_config['mailuser_name'].' unzip -qq -o  '.escapeshellarg($record['maildir'].'/'.$mail_backup['filename']).' -d '.escapeshellarg($record['maildir']).' 2> /dev/null';
                            exec($command,$tmp_output, $retval);
                            unlink($record['maildir'].'/'.$mail_backup['filename']);
                        }
                        if($mail_backup['backup_mode'] == 'rootgz') {
                            $command='tar xfz '.escapeshellarg($mail_backup_file).' --directory '.escapeshellarg($record['maildir']);
                            exec($command,$tmp_output, $retval);
                        }
                        if($retval == 0) {
                            // Now import backup-mailbox into special backup-folder
                            $backupname = "backup-".date("Y-m-d", $mail_backup['tstamp']);
                            exec("doveadm mailbox create -u \"".$record["email"]."\" $backupname");
                            exec("doveadm import -u \"".$record["email"]."\" mdbox:".$record['maildir']."/backup $backupname all", $tmp_output, $retval);
                            exec("for f in `doveadm mailbox list -u \"".$record["email"]."\" $backupname*`; do doveadm mailbox subscribe -u \"".$record["email"]."\" \$f; done", $tmp_output, $retval);
                            exec('rm -rf '.$record['maildir'].'/backup');
                        }
                        if($retval == 0){
                            $app->log('Restored Mail backup '.$mail_backup_file,LOGLEVEL_DEBUG);
                        } else {
                            // cleanup
                            if (file_exists($record['maildir'].'/'.$mail_backup['filename'])) unlink($record['maildir'].'/'.$mail_backup['filename']);
                            if (file_exists($record['maildir']."/backup")) exec('rm -rf '.$record['maildir']."/backup");
                if ($action_name == 'backup_restore_mail') {
                    if(file_exists($mail_backup_file) && $record['homedir'] != '' && $record['homedir'] != '/' && !stristr($mail_backup_file,'..') && !stristr($mail_backup_file,'etc') && $mail_config['homedir_path'] == $record['homedir'] && is_dir($domain_dir) && is_dir($record['maildir'])) {
                        if ($record['maildir_format'] == 'mdbox') {
                            $retval = -1;
                            // First unzip backupfile to local backup-folder
                            if($mail_backup['backup_mode'] == 'userzip') {
                                copy($mail_backup_file, $record['maildir'].'/'.$mail_backup['filename']);
                                chgrp($record['maildir'].'/'.$mail_backup['filename'], $mail_config['mailuser_group']);
                                $command = 'sudo -u '.$mail_config['mailuser_name'].' unzip -qq -o  '.escapeshellarg($record['maildir'].'/'.$mail_backup['filename']).' -d '.escapeshellarg($record['maildir']).' 2> /dev/null';
                                exec($command,$tmp_output, $retval);
                                unlink($record['maildir'].'/'.$mail_backup['filename']);
                            }
                            if($mail_backup['backup_mode'] == 'rootgz') {
                                $command='tar xfz '.escapeshellarg($mail_backup_file).' --directory '.escapeshellarg($record['maildir']);
                                exec($command,$tmp_output, $retval);
                            }
                            
                            $app->log('Unable to restore Mail backup '.$mail_backup_file.' '.$tmp_output,LOGLEVEL_ERROR);
                        }
                    }
                    else {
                        if($mail_backup['backup_mode'] == 'userzip') {
                            copy($mail_backup_file, $domain_dir.'/'.$mail_backup['filename']);
                            chgrp($domain_dir.'/'.$mail_backup['filename'], $mail_config['mailuser_group']);
                            $command = 'sudo -u '.$mail_config['mailuser_name'].' unzip -qq -o  '.escapeshellarg($domain_dir.'/'.$mail_backup['filename']).' -d '.escapeshellarg($domain_dir).' 2> /dev/null';
                            exec($command,$tmp_output, $retval);
                            unlink($domain_dir.'/'.$mail_backup['filename']);
                            if($retval == 0) {
                                // Now import backup-mailbox into special backup-folder
                                $backupname = "backup-".date("Y-m-d", $mail_backup['tstamp']);
                                exec("doveadm mailbox create -u \"".$record["email"]."\" $backupname");
                                exec("doveadm import -u \"".$record["email"]."\" mdbox:".$record['maildir']."/backup $backupname all", $tmp_output, $retval);
                                exec("for f in `doveadm mailbox list -u \"".$record["email"]."\" $backupname*`; do doveadm mailbox subscribe -u \"".$record["email"]."\" \$f; done", $tmp_output, $retval);
                                exec('rm -rf '.$record['maildir'].'/backup');
                            }
                            if($retval == 0){
                                $app->log('Restored Mail backup '.$mail_backup_file,LOGLEVEL_DEBUG);
                            } else {
                                // cleanup
                                if (file_exists($record['maildir'].'/'.$mail_backup['filename'])) unlink($record['maildir'].'/'.$mail_backup['filename']);
                                if (file_exists($record['maildir']."/backup")) exec('rm -rf '.$record['maildir']."/backup");
                                $app->log('Unable to restore Mail backup '.$mail_backup_file.' '.$tmp_output,LOGLEVEL_ERROR);
                            }
                        }
                        if($mail_backup['backup_mode'] == 'rootgz') {
                            $command='tar xfz '.escapeshellarg($mail_backup_file).' --directory '.escapeshellarg($domain_dir);
                            exec($command,$tmp_output, $retval);
                            if($retval == 0){
                                $app->log('Restored Mail backup '.$mail_backup_file,LOGLEVEL_DEBUG);
                            } else {
                                $app->log('Unable to restore Mail backup '.$mail_backup_file.' '.$tmp_output,LOGLEVEL_ERROR);
                        else {
                            if($mail_backup['backup_mode'] == 'userzip') {
                                copy($mail_backup_file, $domain_dir.'/'.$mail_backup['filename']);
                                chgrp($domain_dir.'/'.$mail_backup['filename'], $mail_config['mailuser_group']);
                                $command = 'sudo -u '.$mail_config['mailuser_name'].' unzip -qq -o  '.escapeshellarg($domain_dir.'/'.$mail_backup['filename']).' -d '.escapeshellarg($domain_dir).' 2> /dev/null';
                                exec($command,$tmp_output, $retval);
                                unlink($domain_dir.'/'.$mail_backup['filename']);
                                if($retval == 0){
                                    $app->log('Restored Mail backup '.$mail_backup_file,LOGLEVEL_DEBUG);
                                } else {
                                    $app->log('Unable to restore Mail backup '.$mail_backup_file.' '.$tmp_output,LOGLEVEL_ERROR);
                                }
                            }
                            if($mail_backup['backup_mode'] == 'rootgz') {
                                $command='tar xfz '.escapeshellarg($mail_backup_file).' --directory '.escapeshellarg($domain_dir);
                                exec($command,$tmp_output, $retval);
                                if($retval == 0){
                                    $app->log('Restored Mail backup '.$mail_backup_file,LOGLEVEL_DEBUG);
                                } else {
                                    $app->log('Unable to restore Mail backup '.$mail_backup_file.' '.$tmp_output,LOGLEVEL_ERROR);
                                }
                            }
                        }
                    }
                }
                if($action_name == 'backup_delete_mail') {
                    if(file_exists($mail_backup_file) && !stristr($mail_backup_file, '..') && !stristr($mail_backup_file, 'etc')) {
                        unlink($mail_backup_file);
                        $sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?";
                        $app->db->query($sql, $conf['server_id'], $mail_backup['parent_domain_id'], $mail_backup['filename']);
                        if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
                        $app->log('unlink '.$backup_dir.'/'.$mail_backup['filename'], LOGLEVEL_DEBUG);
                    }
                }
                if( $server_config['backup_dir_is_mount'] == 'y' ) $app->system->umount_backup_dir($backup_dir);
            } else {
                $app->log('Backup directory not ready.', LOGLEVEL_DEBUG);