Alternc  latest
Alternc logiel libre pour l'hébergement
sql_getparam.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  * Show the settings (may be plural) available
22  * to access a MySQL database for an account
23  *
24  * @copyright AlternC-Team 2000-2017 https://alternc.com/
25  */
26 
27 require_once("../class/config.php");
28 include_once("head.php");
29 
30 $fields = array (
31  "dbname" => array ("request", "string", ""),
32 );
34 if (!$res=$mysql->get_dblist()) {
35  $error=$err->errstr();
36 }
37 
38 $res=$mysql->get_defaultsparam($dbname);
39 
40 ?>
41 <h3><?php printf(_("MySQL settings for database '%s'"),$dbname); ?></h3>
42 <hr id="topbar"/>
43 <br />
44 <?php
45 echo $msg->msg_html_all();
46 
47 if ($msg->has_msgs("ERROR")) {
48  include_once("foot.php");
49  exit();
50 }
51 ?>
52 <p><?php __("Your current connection settings are"); ?> : </p>
53 
54 <?php
55 $i = 0;
56 foreach ($res as $r) {
57  $i++;
58 ?>
59 <table class="tedit">
60  <tr>
61  <th colspan="2" style='text-align:center;'><?php echo '<h1>'._("Database Settings").'</h1>'; ?></th>
62  </tr>
63  <tr>
64  <th><?php __("Mysql Server"); ?></th>
65  <td><code><?php echo $mysql->dbus->Host; ?></code></td>
66  </tr>
67  <tr>
68  <th><?php __("Database"); ?></th>
69  <td><code><?php ehe($dbname); ?></code></td>
70  </tr>
71 <?php
72 if(isset($r['user'])){
73 ?>
74  <tr>
75  <th><?php __("Login"); ?></th>
76  <td><code><?php echo $r['user']; ?></code></td>
77  </tr>
78  <tr>
79  <th><?php __("Password"); ?></th>
80  <td><code><?php echo $r['password']; ?></code></td>
81  </tr>
82  <tr>
83  <th><?php __("User Rights"); ?></th>
84 <?php
85 
86 // We test the 'Rights' value to know if this user have all or only specific rights.
87 if ($r["Rights"] == 'All') {
88  $rights = _("All permissions");
89 } else {
90  $rights = "<span style='color:orange;'>"._("Specific permissions")."</span>";
91 }
92 ?>
93 <td>
94 <?php echo $rights; ?>
95 &nbsp;
96 <a class="inb permissions" href="sql_users_rights.php?id=<?php echo $r["user"] ?>"><?php __("Manage the rights"); ?></a>
97 </td>
98  </tr>
99 <?php
100 }
101 ?>
102 </table>
103 
104 <p>
105  <a class="inb settings" href="/sql_pma_sso.php?db=<?php echo $dbname; ?>" target="_blank"><?php __("Access PhpMyAdmin interface"); ?></a>
106 </p>
107 <p>
108 
109 
110 <?php
111 if(!isset($r['user'])){
112  echo "<p class=\"alert alert-warning\">";__("You changed the MySQL User base configuration. Please refer to your configuration");echo"</p><p>&nbsp;</p>";
113 }
114 ?>
115 <br>
116 <?php
117 } // end foreach
118 ?>
119 <p><span class="ina back"><a href="sql_list.php"><?php __("Back to the MySQL database list"); ?></a></span></p>
120 
121 
122 <?php
123  include_once("foot.php");
124 ?>
125 
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
$err
Definition: bootstrap.php:72
$r
Definition: aws_add.php:75
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
if(! $res=$mysql->get_dblist()) $res
$i
$fields
Show the settings (may be plural) available to access a MySQL database for an account.
$error
Definition: ssl_delete.php:45