Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
sql_bck.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: sql_bck.php,v 1.8 2003/10/09 00:54:58 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 Backup
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 ?>
34 <h3><?php __("MySQL Databases - Configure backups"); ?></h3>
35 <hr id="topbar"/>
36 <br />
37 <?php
38 
39 if ( ! variable_get('sql_allow_users_backups') ) {
40  echo "<p class=\"alert alert-danger\">"._("You aren't allowed to access this page. Contact your administrator if you want to.")."</p>";
41  include_once('foot.php');
42  exit;
43 }
44 
45 $fields = array (
46  "id" => array ("request", "string", ""),
47  "bck_mode" => array ("request", "integer", 0),
48  "bck_history" => array ("request", "integer", 7),
49  "bck_gzip" => array ("request", "integer", 0),
50  "bck_dir" => array ("request", "string", "/"),
51 
52 );
54 
55 if (!$r=$mysql->get_mysql_details($id)) {
56  $error=$err->errstr();
57 }
58 
59 if (isset($error) && $error) {
60  echo "<p class=\"alert alert-danger\">$error</p><p>&nbsp;</p>";
61 }
62 
63 if (is_array($r)) {
64 ?>
65 <h3><?php printf(_("Manage the SQL backup for database %s"),$r["db"]); ?></h3>
66 
67 <form action="sql_dobck.php" method="post" id="main" name="main">
68 <table class="tedit">
69 <tr>
70  <th><label><?php __("Do MySQL backup?"); ?></label></th>
71  <td>
72  <input type="hidden" name="id" value="<?php echo $id; ?>" />
73  <input type="radio" class="inc" id="bck_mode0" name="bck_mode" value="0"<?php cbox($r["bck"]==0); ?>/><label for="bck_mode0"><?php __("No backup"); ?></label><br />
74  <input type="radio" class="inc" id="bck_mode1" name="bck_mode" value="1"<?php cbox($r["bck"]==1); ?>/><label for="bck_mode1"><?php __("Weekly backup"); ?></label><br />
75  <input type="radio" class="inc" id="bck_mode2" name="bck_mode" value="2"<?php cbox($r["bck"]==2); ?>/><label for="bck_mode2"><?php __("Daily backup"); ?></label><br />
76  </td>
77 </tr>
78 <tr>
79  <th><label for="bck_history"><?php __("How many backups should be kept?"); ?></label></th>
80  <td><select class="inl" name="bck_history" id="bck_history">
81  <?php
82  for($i=1;$i<20;$i++) {
83  echo "<option";
84  if ($r["history"]==$i) echo " selected=\"selected\"";
85  echo ">$i</option>";
86  }
87  ?>
88  </select></td>
89 </tr>
90 <tr>
91  <th><label><?php __("Compress the backups? (gzip)"); ?></label></th>
92  <td>
93 
94  <input type="radio" class="inc" id="bck_gzip0" name="bck_gzip" value="0"<?php cbox($r["gzip"]==0); ?>/><label for="bck_gzip0"><?php __("No"); ?></label><br />
95  <input type="radio" class="inc" id="bck_gzip1" name="bck_gzip" value="1"<?php cbox($r["gzip"]==1); ?>/><label for="bck_gzip1"><?php __("Yes"); ?></label><br />
96 
97 </td>
98 </tr>
99 <tr>
100  <th><label for="bck_dir"><?php __("In which folder do you want to store the backups?"); ?></label></th>
101  <td><input type="text" class="int" name="bck_dir" id="bck_dir" size="30" maxlength="255" value="<?php @ehe($r["dir"]); ?>" />
102  <?php display_browser( isset($r["dir"])?$r["dir"]:"" , "main.bck_dir" ); ?>
103 </td>
104 </tr>
105 
106 <tr class="trbtn"><td colspan="2">
107  <input class="inb ok" type="submit" name="submit" value="<?php __("Change the MySQL backup parameters"); ?>" />
108  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='sql_list.php'"/>
109 </td></tr>
110 </table>
111 </form>
112 <?php
113  $mem->show_help("sql_bck");
114  } else {
115  echo "<p>";
116 __("You currently have no database defined");
117  echo "</p>";
118  }
119 ?>
120 <script type="text/javascript">
121 document.forms['main'].bck_mode.focus();
122 </script>
123 <?php include_once("foot.php"); ?>