AlternC/bureau/admin/sql_restore.php

86 lines
3.1 KiB
PHP
Raw Normal View History

<?php
/*
$Id: sql_restore.php,v 1.5 2003/06/10 13:16:11 root Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: Manage the MySQL Restore
----------------------------------------------------------------------
*/
require_once("../class/config.php");
2009-09-08 05:29:38 +00:00
include_once("head.php");
$fields = array (
"id" => array ("request", "string", ""),
"filename" => array ("request", "string", ""),
2009-09-08 05:29:38 +00:00
);
getFields($fields);
if (!$r=$mysql->get_mysql_details($id)) {
$error=$err->errstr();
}
?>
<h3><?php __("MySQL Databases"); ?></h3>
2010-05-27 15:10:45 +00:00
<hr id="topbar"/>
<br />
<?php
if (!empty($error)) {
2013-10-18 09:59:03 +00:00
echo "<p class=\"alert alert-danger\">$error</p><p>&nbsp;</p>";
}
if (!is_array($r)) {
echo "<p>"._("You currently have no database defined")."</p>";
include_once("foot.php");
exit;
}
?>
<h3><?php printf(_("Restore a MySQL backup for database %s"),$r["db"]); ?></h3>
2010-05-27 13:47:27 +00:00
<?php
echo "<p>";
2010-05-27 14:01:35 +00:00
__("Warning: Write the complete path and the filename. <br />For example if your backups are in the directory /Backups,<br />write /Backups/file.sql.gz (where file.sql.gz is the filename).");
2010-05-27 13:47:27 +00:00
echo "</p>";
?>
<form action="sql_dorestore.php" method="post">
<?php csrf_get(); ?>
<input type="hidden" name="id" value="<?php ehe($id); ?>" />
2010-06-02 18:47:39 +00:00
<p><label for="restfile"><?php __("Please enter the path and the filename containing SQL data to be restored."); ?></label></p>
<p><input type="text" class="int" id="restfile" name="restfile" size="35" maxlength="255" value="<?php ehe($filename); ?>" /> <input class="inb" type="submit" name="submit" onClick='return restfilenotempty();' value="<?php __("Restore my database"); ?>" /><i><?php __("Tip: you can restore a file directly in the File Browser");?></i></p>
</form>
2013-02-01 08:24:53 +00:00
<script type="text/javascript">
function restfilenotempty() {
if ( $('#restfile').val() == '' ) {
alert("<?php __("Please the complete path of the filename");?>");
return false;
} else {
return true;
}
}
</script>
<?php
echo "<p>";
__("Note: If the filename ends with .gz, it will be uncompressed before.");
echo "</p>";
?>
2009-09-08 05:29:38 +00:00
<?php include_once("foot.php"); ?>