Alternc  latest
Alternc logiel libre pour l'hébergement
sql_users_list.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Manages the MySQL users of an account
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 $r=$mysql->get_userslist();
30 $rdb=$mysql->get_dblist();
31 
32 ?>
33 <h3><?php __("MySQL Users"); ?></h3>
34 <hr id="topbar"/>
35 <br />
36 <?php
37 echo $msg->msg_html_all(true, true);
38 
39 if($r){ // if there is some userlist
40 ?>
41 <form method="post" action="sql_users_del.php">
42  <?php csrf_get(); ?>
43 <table cellspacing="0" cellpadding="4" class="tlist">
44  <tr><th>&nbsp;</th><th><?php __("User"); ?></th><th><?php __("Rights"); ?></th><th><?php __("Password");?></th></tr>
45 <?php
46 for($i=0;$i<count($r);$i++) {
47  $val=$r[$i];
48 ?>
49  <tr class="lst">
50  <td align="center">
51  <input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="del_<?php echo $val["name"]; ?>" value="<?php echo $val["name"]; ?>" />
52  </td>
53  <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $val["name"]; ?></label></td>
54  <td><span class="ina permissions"><a href="sql_users_rights.php?id=<?php echo $val["name"] ?>"><?php __("Manage the rights"); ?></a></span></td>
55  <td><span class="ina lock"><a href="sql_users_password.php?id=<?php echo $val["name"] ?>"><?php __("Password change"); ?></a></span></td>
56  </tr>
57 <?php
58 
59 
60  }
61 ?>
62 
63 </table>
64 
65 <p>
66 <button type="submit" name="sub" class="inb delete"><?php __("Delete the checked users"); ?></button>
67 </p>
68 </form>
69 
70 <?php
71  } else {
72  $msg->raise("INFO", "mysql", _("You have no sql user at the moment."));
73  echo $msg->msg_html_all();
74  }
75 ?>
76 <p>
77  <span class="ina add"><a href="sql_users_add.php"><?php __("Create a new MySQL user"); ?></a></span>
78 </p>
79 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
__($str)
Definition: functions.php:404
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$i
$r
Manages the MySQL users of an account.
$val
Definition: tempovars.php:15