Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
sql_restore.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: sql_restore.php,v 1.5 2003/06/10 13:16:11 root Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Manage the MySQL Restore
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 $fields = array (
34  "id" => array ("request", "string", ""),
35  "filename" => array ("request", "string", ""),
36 );
38 
39 if (!$r=$mysql->get_mysql_details($id)) {
40  $error=$err->errstr();
41 }
42 
43 ?>
44 <h3><?php __("MySQL Databases"); ?></h3>
45 <hr id="topbar"/>
46 <br />
47 <?php
48 if (!empty($error)) {
49  echo "<p class=\"alert alert-danger\">$error</p><p>&nbsp;</p>";
50 }
51 
52 if (!is_array($r)) {
53  echo "<p>"._("You currently have no database defined")."</p>";
54  include_once("foot.php");
55  exit;
56 }
57 ?>
58 <h3><?php printf(_("Restore a MySQL backup for database %s"),$r["db"]); ?></h3>
59 <?php
60 echo "<p>";
61 __("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).");
62 echo "</p>";
63 ?>
64 <form action="sql_dorestore.php" method="post">
65 <input type="hidden" name="id" value="<?php echo $id ?>" />
66 <p><label for="restfile"><?php __("Please enter the path and the filename containing SQL data to be restored."); ?></label></p>
67 <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>
68 </form>
69 <script type="text/javascript">
70  function restfilenotempty() {
71  if ( $('#restfile').val() == '' ) {
72  alert("<?php __("Please the complete path of the filename");?>");
73  return false;
74  } else {
75  return true;
76  }
77  }
78 </script>
79 <?php
80 echo "<p>";
81 __("Note: If the filename ends with .gz, it will be uncompressed before.");
82 echo "</p>";
83 ?>
84 <?php include_once("foot.php"); ?>