From: Janusz Dobrowolski Date: Mon, 10 Nov 2008 13:32:38 +0000 (+0000) Subject: Suppressed page update after import errors. X-Git-Tag: v2.4.2~19^2~1778 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=0b374a9cb65ebe32dbc17eac566e1d0ba92cb3ce;p=fa-stable.git Suppressed page update after import errors. --- diff --git a/admin/backups.php b/admin/backups.php index 9796a492..e6537579 100644 --- a/admin/backups.php +++ b/admin/backups.php @@ -168,8 +168,8 @@ function handle_form($conn) if ($_GET['c']=='r') { $filename=$_GET['fn']; - restore_backup(BACKUP_PATH . $filename, $conn); - header("Location: backups.php?c=rs&fn=" . urlencode($filename)); + if( restore_backup(BACKUP_PATH . $filename, $conn) ) + header("Location: backups.php?c=rs&fn=" . urlencode($filename)); return ""; } //Print restore success message @@ -184,8 +184,10 @@ function handle_form($conn) $filename = $_FILES['uploadfile']['tmp_name']; if (is_uploaded_file ($filename)) { - restore_backup($filename, $conn); - $msg = _("Uploaded file has been restored."); + if( restore_backup($filename, $conn) ) + $msg = _("Uploaded file has been restored."); + else + $msg = _("Database restore failed."); } else {