diff --git a/bureau/admin/sql_dorestore.php b/bureau/admin/sql_dorestore.php index 7a6a03a9..de76a2df 100644 --- a/bureau/admin/sql_dorestore.php +++ b/bureau/admin/sql_dorestore.php @@ -35,33 +35,36 @@ $fields = array ( "restfile" => array ("post", "string", ""), ); getFields($fields); +?> +
+"._("You currently have no database defined")."
"; + include_once("foot.php"); + die(); +} ?> - -restore($restfile,true,$id)) { - $error=$err->errstr(); + $error=$err->errstr(); } else { - $error=_("Your database has been restored, check out the previous text for error messages."); -} + $error=_("Your database has been restored, check out the previous text for error messages."); +} // if mysql->restore echo "
$error
"; -} else { -__("You currently have no database defined"); - -} ?> diff --git a/bureau/admin/sql_restore.php b/bureau/admin/sql_restore.php index 7e49b52e..94484202 100644 --- a/bureau/admin/sql_restore.php +++ b/bureau/admin/sql_restore.php @@ -59,8 +59,18 @@ echo ""; + "; __("Note: If the filename ends with .gz, it will be uncompressed before."); diff --git a/bureau/class/m_mysql.php b/bureau/class/m_mysql.php index 2e05d969..73585159 100644 --- a/bureau/class/m_mysql.php +++ b/bureau/class/m_mysql.php @@ -487,6 +487,11 @@ class m_mysql { $err->raise("mysql",_("File not found")); return false; } + if (!file_exists($fi)) { + $err->raise("mysql",_("File not found")); + return false; + } + if (substr($fi,-3)==".gz") { $exe="/bin/gzip -d -c <".escapeshellarg($fi)." | /usr/bin/mysql -h".escapeshellarg($L_MYSQL_HOST)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"]); } elseif (substr($fi,-4)==".bz2") {