Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2015-08-31 15:28:03 +0300
committerMadhura Jayaratne <madhura.cj@gmail.com>2015-08-31 15:28:03 +0300
commit3c118b8106ee5e67a34e90686e9ce0167bd69236 (patch)
treec9fd19ccda917d6b57fd8e173cb3a3e242947457 /server_variables.php
parent087fe8a72ffc5a741fa8457c914bcd640e6b09e3 (diff)
Fix #11446 MySQL 5.7 and Variables page for an unprivileged user
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'server_variables.php')
-rw-r--r--server_variables.php41
1 files changed, 35 insertions, 6 deletions
diff --git a/server_variables.php b/server_variables.php
index ac2bf5e0a2..b0708662a0 100644
--- a/server_variables.php
+++ b/server_variables.php
@@ -46,13 +46,42 @@ $doc_link = PMA_Util::showMySQLDocu('server_system_variables');
$response->addHtml(PMA_getHtmlForSubPageHeader('variables', $doc_link));
/**
- * Link templates
+ * Sends the queries and buffers the results
*/
-$response->addHtml(PMA_getHtmlForLinkTemplates());
+$serverVarsResult = $GLOBALS['dbi']->tryQuery('SHOW SESSION VARIABLES;');
-/**
- * Displays the page
- */
-$response->addHtml(PMA_getHtmlForServerVariables($variable_doc_links));
+if ($serverVarsResult !== false) {
+
+ $serverVarsSession = array();
+ while ($arr = $GLOBALS['dbi']->fetchRow($serverVarsResult)) {
+ $serverVarsSession[$arr[0]] = $arr[1];
+ }
+ $GLOBALS['dbi']->freeResult($serverVarsResult);
+
+ $serverVars = $GLOBALS['dbi']->fetchResult('SHOW GLOBAL VARIABLES;', 0, 1);
+
+ /**
+ * Link templates
+ */
+ $response->addHtml(PMA_getHtmlForLinkTemplates());
+
+ /**
+ * Displays the page
+ */
+ $response->addHtml(
+ PMA_getHtmlForServerVariables(
+ $variable_doc_links, $serverVars, $serverVarsSession
+ )
+ );
+} else {
+ /**
+ * Display the error message
+ */
+ $response->addHTML(
+ PMA_Message::error(
+ __('Not enough privilege to view server variables and settings.')
+ )->getDisplay()
+ );
+}
exit;