Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
sql_users_rights.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: sql_users_rights.php,v 1.8 2006/02/16 16:26:28 nahuel 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: Nahuel ANGELINETTI
27  Purpose of file: Manage the MySQL users of a member
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 $fields = array (
34  "id" => array ("request", "string", ""),
35 );
37 ?>
38 <h3><?php printf(_("MySQL Rights for %s"),$id) ?></h3>
39 <hr id="topbar"/>
40 <br />
41 <?php
42 $r=$mysql->get_user_dblist($id);
43 if (!$r) {
44  $error=$err->errstr();
45 }
46 
47 if (!empty($error)) {
48  echo "<p class=\"alert alert-danger\">$error</p><p>&nbsp;</p>";
49  require_once('foot.php');
50 }
51 
52 if ($r) {
53 
54 ?>
55 
56 <form method="post" action="sql_users_dorights.php">
57 <input type="hidden" name="id" value="<?php echo $id; ?>" />
58 <table cellspacing="0" cellpadding="4" class="tlist ombrage">
59  <tr class="petit">
60  <th>&nbsp;</th>
61  <th>&nbsp;</th>
62  <th>SELECT</th>
63  <th>INSERT</th>
64  <th>UPDATE</th>
65  <th>DELETE</th>
66  <th>CREATE</th>
67  <th>DROP</th>
68  <th>REFERENCES</th>
69  <th>INDEX</th>
70  <th>ALTER</th>
71  <th>CREATE_TMP_TABLE</th>
72  <th>LOCK</th>
73  <th>CREATE VIEW</th>
74  <th>SHOW VIEW</th>
75  <th>CREATE ROUTINE</th>
76  <th>ALTER ROUTINE</th>
77  <th>EXECUTE</th>
78  <th>EVENT</th>
79  <th>TRIGGER</th>
80  </tr>
81 
82 <?php
83 $sql_right=$mysql->available_sql_rights();
84 for($i=0;$i<count($r);$i++) {
85  $val=$r[$i];
86 ?>
87  <tr class="lst">
88  <td><strong><?php echo $val["db"] ?></strong></td>
89  <td><a href="javascript:inverse_sql_right('<?php echo htmlentities($val["db"]);?>');"><?php __('Reverse selection');?></a></td>
90  <?php foreach($sql_right as $sr) { ?>
91  <td align="center">
92  <input type="checkbox" class="inc" id="<?php echo $val["db"]."_$sr"; ?>" name="<?php echo $val["db"]."_$sr"; ?>"<?php if($val[$sr]=="Y") echo " checked=\"checked\""; ?> />
93  </td>
94  <?php } ?>
95  </tr>
96 <?php
97 
98 
99  }
100 ?>
101 </table>
102 <p>
103  <input type="submit" class="inb ok" value="<?php __("Apply"); ?>"/>
104  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='sql_users_list.php'"/>
105 </p>
106 </form>
107 <p>&nbsp;</p>
108 <script type="text/javascript">
109 function inverse_sql_right(db) {
110  <?php foreach($sql_right as $sr) { ?>
111  if ( document.getElementById(db+'_<?php echo $sr;?>').checked ) {
112  document.getElementById(db+'_<?php echo $sr;?>').checked=false;
113  } else {
114  document.getElementById(db+'_<?php echo $sr;?>').checked=true;
115  }
116  <?php } ?>
117 }
118 
119 </script>
120 <?php } ?>
121 <?php include_once("foot.php"); ?>