Skip to content

Commit b516281

Browse files
author
Dominik Müller
committed
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
1 parent 6b166b8 commit b516281

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
2+
ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';

install/sql/ispconfig3.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ CREATE TABLE `mail_backup` (
703703
`backup_mode` varchar(64) NOT NULL DEFAULT '',
704704
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
705705
`filename` varchar(255) NOT NULL DEFAULT '',
706-
`filesize` VARCHAR(10) NOT NULL DEFAULT '',
706+
`filesize` VARCHAR(20) NOT NULL DEFAULT '',
707707
PRIMARY KEY (`backup_id`)
708708
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
709709

@@ -1746,7 +1746,7 @@ CREATE TABLE `web_backup` (
17461746
`backup_mode` varchar(64) NOT NULL DEFAULT '',
17471747
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
17481748
`filename` varchar(255) NOT NULL DEFAULT '',
1749-
`filesize` VARCHAR(10) NOT NULL DEFAULT '',
1749+
`filesize` VARCHAR(20) NOT NULL DEFAULT '',
17501750
PRIMARY KEY (`backup_id`)
17511751
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
17521752

interface/web/mail/templates/mail_user_backup_list.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ <h3><tmpl_var name="list_head_txt"></h3>
2626
<td>{tmpl_var name="filesize"}</td>
2727
<td class="text-right">
2828
<div class="buttons">
29-
<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>
30-
<!-- <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>
29+
<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>
30+
<!-- <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>
3131
-->
3232
</div>
3333
</td>

server/plugins-available/backup_plugin.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public function onLoad() {
5353
//* Register for actions
5454
$app->plugins->registerAction('backup_download', $this->plugin_name, 'backup_action');
5555
$app->plugins->registerAction('backup_restore', $this->plugin_name, 'backup_action');
56-
56+
$app->plugins->registerAction('backup_mailrestore', $this->plugin_name, 'backup_action');
57+
5758
}
5859

5960
//* Do a backup action
@@ -64,7 +65,7 @@ public function backup_action($action_name, $data) {
6465
$backup = $app->dbmaster->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = $backup_id");
6566
$mail_backup = $app->dbmaster->queryOneRecord("SELECT * FROM mail_backup WHERE backup_id = $backup_id");
6667

67-
if(is_array($backup)) {
68+
if(is_array($backup) && ($action_name != 'backup_mailrestore')) {
6869

6970
$app->uses('ini_parser,file,getconf,system');
7071

@@ -159,7 +160,7 @@ public function backup_action($action_name, $data) {
159160
$app->log('Backup directory not ready.', LOGLEVEL_DEBUG);
160161
}
161162
//* Restore a mail backup - florian@schaal-24.de
162-
} elseif (is_array($mail_backup) && $action_name == 'backup_restore') {
163+
} elseif (is_array($mail_backup) && ($action_name == 'backup_mailrestore')) {
163164
$app->uses('ini_parser,file,getconf');
164165

165166
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');

0 commit comments

Comments
 (0)