update
[phpmyadmin/crack.git] / server_variables.php3
blobd13b3bcecb6a2a8cf1a70e8ec48166ba1dce6909
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Does the common work
8 */
9 require('./server_common.inc.php3');
12 /**
13 * Displays the links
15 require('./server_links.inc.php3');
18 /**
19 * Displays the sub-page heading
21 echo '<h2>' . "\n"
22 . ' ' . $strServerVars . "\n"
23 . '</h2>' . "\n";
26 /**
27 * Checks if the user is allowed to do what he tries to...
29 if (!$is_superuser && !$cfg['ShowMysqlVars']) {
30 echo $strNoPrivileges;
31 include('./footer.inc.php3');
32 exit;
36 /**
37 * Sends the queries and buffers the results
39 if (PMA_MYSQL_INT_VERSION >= 40003) {
40 $res = @PMA_mysql_query('SHOW SESSION VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW SESSION VARIABLES;');
41 while ($row = PMA_mysql_fetch_row($res)) {
42 $serverVars[$row[0]] = $row[1];
44 @mysql_free_result($res);
45 $res = @PMA_mysql_query('SHOW GLOBAL VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW GLOBAL VARIABLES;');
46 while ($row = PMA_mysql_fetch_row($res)) {
47 $serverVarsGlobal[$row[0]] = $row[1];
49 @mysql_free_result($res);
50 } else {
51 $res = @PMA_mysql_query('SHOW VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW VARIABLES;');
52 while ($row = PMA_mysql_fetch_row($res)) {
53 $serverVars[$row[0]] = $row[1];
55 @mysql_free_result($res);
57 unset($res);
58 unset($row);
61 /**
62 * Displays the page
65 <table border="0">
66 <tr>
67 <th>&nbsp;<?php echo $strVar; ?>&nbsp;</th>
68 <?php
69 echo ' <th>&nbsp;';
70 if (PMA_MYSQL_INT_VERSION >= 40003) {
71 echo $strSessionValue . '&nbsp;</th>' . "\n"
72 . ' <th>&nbsp;' . $strGlobalValue;
73 } else {
74 echo $strValue;
76 echo '&nbsp;</th>' . "\n";
78 </tr>
79 <?php
80 $useBgcolorOne = TRUE;
81 while (list($name, $value) = each($serverVars)) {
83 <tr>
84 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
85 <?php echo htmlspecialchars(str_replace('_', ' ', $name)) . "\n"; ?>
86 </td>
87 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
88 <?php echo htmlspecialchars($value) . "\n"; ?>
89 </td>
90 <?php
91 if (PMA_MYSQL_INT_VERSION >= 40003) {
93 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
94 <?php echo htmlspecialchars($serverVarsGlobal[$name]) . "\n"; ?>
95 </td>
96 <?php
98 $useBgcolorOne = !$useBgcolorOne;
100 </tr>
101 <?php
104 </table>
105 <?php
109 * Sends the footer
111 require('./footer.inc.php3');