Dominik Müller
2015-01-10 b5162814731703530b89d9d7d3aac63dd2fd3cd5
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
3 files modified
1 files added
17 ■■■■■ changed files
install/sql/incremental/upd_0082.sql 2 ●●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 4 ●●●● patch | view | raw | blame | history
interface/web/mail/templates/mail_user_backup_list.htm 4 ●●●● patch | view | raw | blame | history
server/plugins-available/backup_plugin.inc.php 7 ●●●●● patch | view | raw | blame | history
install/sql/incremental/upd_0082.sql
New file
@@ -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 '';
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 ;
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>
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');