projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rerun fixed_assets attachments (items.php)
[fa-stable.git]
/
admin
/
backups.php
diff --git
a/admin/backups.php
b/admin/backups.php
index 32130e5bccb155c6ecdf4e31f2f7821098786590..01ef0732acc41e8be64c2903e651c0a87a4eeec9 100644
(file)
--- a/
admin/backups.php
+++ b/
admin/backups.php
@@
-24,14
+24,21
@@
if (get_post('view')) {
if (in_ajax())
$Ajax->popup( $filename );
else {
if (in_ajax())
$Ajax->popup( $filename );
else {
- header('Content-type: text/plain');
- header('Content-Length: '.filesize($filename));
+
header('Content-type: text/plain');
+
header('Content-Length: '.filesize($filename));
header("Content-Disposition: inline; filename=".basename($filename));
header("Content-Disposition: inline; filename=".basename($filename));
- readfile($filename);
+ if (substr($filename, -3, 3) == '.gz')
+ header("Content-Encoding: gzip");
+
+ if (substr($filename, -4, 4) == '.zip')
+ echo db_unzip('', $filename);
+ else
+ readfile($filename);
exit();
}
}
};
exit();
}
}
};
+
if (get_post('download')) {
if (get_post('backups')) {
download_file($SysPrefs->backup_dir().clean_file_name(get_post('backups')));
if (get_post('download')) {
if (get_post('backups')) {
download_file($SysPrefs->backup_dir().clean_file_name(get_post('backups')));
@@
-134,11
+141,12
@@
$backup_path = $SysPrefs->backup_dir() . $backup_name;
if (get_post('creat')) {
generate_backup($conn, get_post('comp'), get_post('comments'));
$Ajax->activate('backups');
if (get_post('creat')) {
generate_backup($conn, get_post('comp'), get_post('comments'));
$Ajax->activate('backups');
+ $SysPrefs->refresh(); // re-read system setup
};
if (get_post('restore')) {
if ($backup_name) {
};
if (get_post('restore')) {
if ($backup_name) {
- if (db_import($backup_path, $conn, true, false, check_value('protect
ed
')))
+ if (db_import($backup_path, $conn, true, false, check_value('protect')))
display_notification(_("Restore backup completed."));
$SysPrefs->refresh(); // re-read system setup
} else
display_notification(_("Restore backup completed."));
$SysPrefs->refresh(); // re-read system setup
} else
@@
-195,7
+203,7
@@
table_section_title(_("Backup scripts maintenance"));
echo "<td style='padding-left:20px' valign='top'>";
start_table();
submit_row('view',_("View Backup"), false, '', '', false);
echo "<td style='padding-left:20px' valign='top'>";
start_table();
submit_row('view',_("View Backup"), false, '', '', false);
- submit_row('download',_("Download Backup"), false, '', '',
false
);
+ submit_row('download',_("Download Backup"), false, '', '',
'download'
);
submit_row('restore',_("Restore Backup"), false, '','', 'process');
submit_js_confirm('restore',_("You are about to restore database from backup file.\nDo you want to continue?"));
submit_row('restore',_("Restore Backup"), false, '','', 'process');
submit_js_confirm('restore',_("You are about to restore database from backup file.\nDo you want to continue?"));