Retrieve parameters from $_POST in ajax.php

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-08-28 22:36:35 -03:00
parent 5109c1787e
commit 88e162b651

View File

@ -27,19 +27,19 @@ switch ($_POST['type']) {
break;
case 'list-tables':
Util::checkParameters(array('db'), true);
$response->addJSON('tables', $GLOBALS['dbi']->getTables($_REQUEST['db']));
$response->addJSON('tables', $GLOBALS['dbi']->getTables($_POST['db']));
break;
case 'list-columns':
Util::checkParameters(array('db', 'table'), true);
$response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_REQUEST['db'], $_REQUEST['table']));
$response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_POST['db'], $_POST['table']));
break;
case 'config-get':
Util::checkParameters(array('key'), true);
$response->addJSON('value', $GLOBALS['PMA_Config']->get($_REQUEST['key']));
$response->addJSON('value', $GLOBALS['PMA_Config']->get($_POST['key']));
break;
case 'config-set':
Util::checkParameters(array('key', 'value'), true);
$result = $GLOBALS['PMA_Config']->setUserValue(null, $_REQUEST['key'], json_decode($_REQUEST['value']));
$result = $GLOBALS['PMA_Config']->setUserValue(null, $_POST['key'], json_decode($_POST['value']));
if ($result !== true) {
$response = Response::getInstance();
$response->setRequestStatus(false);