Commit b5162814 authored by Dominik Müller's avatar Dominik Müller

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
parent 6b166b8a
ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
......@@ -703,7 +703,7 @@ CREATE TABLE `mail_backup` (
`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 @@ CREATE TABLE `web_backup` (
`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 ;
......
......@@ -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>
......
......@@ -53,7 +53,8 @@ class backup_plugin {
//* 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 @@ class backup_plugin {
$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 @@ class backup_plugin {
$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');
......
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