/**
* Index action
*
* @return void
*/
public function indexAction()
{
$request = Request::getInstance();
if ($request->isAjax() && isset($_REQUEST['type']) && $_REQUEST['type'] === 'getval') {
$this->getValueAction();
return;
}
if ($request->isAjax() && isset($_REQUEST['type']) && $_REQUEST['type'] === 'setval') {
$this->setValueAction();
return;
}
include 'libraries/server_common.inc.php';
$header = $this->response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_variables.js');
/**
* Displays the sub-page heading
*/
$doc_link = Util::showMySQLDocu('server_system_variables');
$this->response->addHtml(PMA_getHtmlForSubPageHeader('variables', $doc_link));
/**
* Sends the queries and buffers the results
*/
$serverVarsResult = $this->dbi->tryQuery('SHOW SESSION VARIABLES;');
if ($serverVarsResult !== false) {
$serverVarsSession = array();
while ($arr = $this->dbi->fetchRow($serverVarsResult)) {
$serverVarsSession[$arr[0]] = $arr[1];
}
$this->dbi->freeResult($serverVarsResult);
$serverVars = $this->dbi->fetchResult('SHOW GLOBAL VARIABLES;', 0, 1);
/**
* Link templates
*/
$this->response->addHtml($this->_getHtmlForLinkTemplates());
/**
* Displays the page
*/
$this->response->addHtml($this->_getHtmlForServerVariables($serverVars, $serverVarsSession));
} else {
/**
* Display the error message
*/
$this->response->addHTML(Message::error(sprintf(__('Not enough privilege to view server variables and ' . 'settings. %s'), Util::showMySQLDocu('server-system-variables', false, 'sysvar_show_compatibility_56')))->getDisplay());
}
}