From b5162814731703530b89d9d7d3aac63dd2fd3cd5 Mon Sep 17 00:00:00 2001
From: Dominik Müller <info@profi-webdesign.com>
Date: Sat, 10 Jan 2015 11:32:58 -0500
Subject: [PATCH] changed filesize fields in backup-tables because of larger files (maximum was 9.9 GB) Fix for mailrestore, to avoid confusion about web- and mail-backups with same ids
---
install/sql/ispconfig3.sql | 4 ++--
interface/web/mail/templates/mail_user_backup_list.htm | 4 ++--
install/sql/incremental/upd_0082.sql | 2 ++
server/plugins-available/backup_plugin.inc.php | 7 ++++---
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/install/sql/incremental/upd_0082.sql b/install/sql/incremental/upd_0082.sql
new file mode 100644
index 0000000..2bd852a
--- /dev/null
+++ b/install/sql/incremental/upd_0082.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
+ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 6c57ce0..8b79165 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -703,7 +703,7 @@
`backup_mode` varchar(64) NOT NULL DEFAULT '',
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
`filename` varchar(255) NOT NULL DEFAULT '',
- `filesize` VARCHAR(10) NOT NULL DEFAULT '',
+ `filesize` VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (`backup_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -1746,7 +1746,7 @@
`backup_mode` varchar(64) NOT NULL DEFAULT '',
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
`filename` varchar(255) NOT NULL DEFAULT '',
- `filesize` VARCHAR(10) NOT NULL DEFAULT '',
+ `filesize` VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (`backup_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
diff --git a/interface/web/mail/templates/mail_user_backup_list.htm b/interface/web/mail/templates/mail_user_backup_list.htm
index 87f1ea3..7c61117 100644
--- a/interface/web/mail/templates/mail_user_backup_list.htm
+++ b/interface/web/mail/templates/mail_user_backup_list.htm
@@ -26,8 +26,8 @@
<td>{tmpl_var name="filesize"}</td>
<td class="text-right">
<div class="buttons">
- <button class="btn btn-default formbutton-default" type="button" onclick="confirm_action('mail/mail_user_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=restore&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" data-load-content="mail/mail_user_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>
+ <button class="btn btn-default formbutton-default" type="button" onclick="confirm_action('mail/mail_user_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=mailrestore&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" data-load-content="mail/mail_user_edit.php?id={tmpl_var name='parent_id'}&next_tab=backup&backup_action=maildownload&backup_id={tmpl_var name='backup_id'}">{tmpl_var name="download_backup_txt"}</button>
-->
</div>
</td>
diff --git a/server/plugins-available/backup_plugin.inc.php b/server/plugins-available/backup_plugin.inc.php
index 863ac98..04e6750 100644
--- a/server/plugins-available/backup_plugin.inc.php
+++ b/server/plugins-available/backup_plugin.inc.php
@@ -53,7 +53,8 @@
//* 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_mailrestore', $this->plugin_name, 'backup_action');
+
}
//* Do a backup action
@@ -64,7 +65,7 @@
$backup = $app->dbmaster->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = $backup_id");
$mail_backup = $app->dbmaster->queryOneRecord("SELECT * FROM mail_backup WHERE backup_id = $backup_id");
- if(is_array($backup)) {
+ if(is_array($backup) && ($action_name != 'backup_mailrestore')) {
$app->uses('ini_parser,file,getconf,system');
@@ -159,7 +160,7 @@
$app->log('Backup directory not ready.', LOGLEVEL_DEBUG);
}
//* Restore a mail backup - florian@schaal-24.de
- } elseif (is_array($mail_backup) && $action_name == 'backup_restore') {
+ } elseif (is_array($mail_backup) && ($action_name == 'backup_mailrestore')) {
$app->uses('ini_parser,file,getconf');
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
--
Gitblit v1.9.1