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
New file |
| | |
| | | ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT ''; |
| | | ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT ''; |
| | |
| | | `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 ; |
| | | |
| | |
| | | `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 ; |
| | | |
| | |
| | | <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> |
| | |
| | | //* 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 |
| | |
| | | $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'); |
| | | |
| | |
| | | $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'); |