another minor fix to prior commit
[openemr.git] / phpmyadmin / server_variables.php
blob7c78db81aaadd0c35728929602a8224bffa15be5
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Server variables
6 * @package PhpMyAdmin
7 */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_variables.lib.php';
12 $response = PMA_Response::getInstance();
13 $header = $response->getHeader();
14 $scripts = $header->getScripts();
15 $scripts->addFile('server_variables.js');
17 /**
18 * Does the common work
20 require 'libraries/server_common.inc.php';
22 /**
23 * Array of documentation links
25 $variable_doc_links = PMA_getArrayForDocumentLinks();
27 /**
28 * Ajax request
31 if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
32 if (isset($_REQUEST['type'])) {
33 if ($_REQUEST['type'] === 'getval') {
34 PMA_getAjaxReturnForGetVal($variable_doc_links);
35 } else if ($_REQUEST['type'] === 'setval') {
36 PMA_getAjaxReturnForSetVal($variable_doc_links);
38 exit;
42 /**
43 * Displays the sub-page heading
45 $doc_link = PMA_Util::showMySQLDocu('server_system_variables');
46 $response->addHtml(PMA_getHtmlForSubPageHeader('variables', $doc_link));
48 /**
49 * Sends the queries and buffers the results
51 $serverVarsResult = $GLOBALS['dbi']->tryQuery('SHOW SESSION VARIABLES;');
53 if ($serverVarsResult !== false) {
55 $serverVarsSession = array();
56 while ($arr = $GLOBALS['dbi']->fetchRow($serverVarsResult)) {
57 $serverVarsSession[$arr[0]] = $arr[1];
59 $GLOBALS['dbi']->freeResult($serverVarsResult);
61 $serverVars = $GLOBALS['dbi']->fetchResult('SHOW GLOBAL VARIABLES;', 0, 1);
63 /**
64 * Link templates
66 $response->addHtml(PMA_getHtmlForLinkTemplates());
68 /**
69 * Displays the page
71 $response->addHtml(
72 PMA_getHtmlForServerVariables(
73 $variable_doc_links, $serverVars, $serverVarsSession
76 } else {
77 /**
78 * Display the error message
80 $response->addHTML(
81 PMA_Message::error(
82 sprintf(
83 __('Not enough privilege to view server variables and settings. %s'),
84 PMA_Util::showMySQLDocu(
85 'server-system-variables',
86 false,
87 'sysvar_show_compatibility_56'
90 )->getDisplay()
94 exit;