Skip to content
Permalink
Browse files

Retrieve parameters from $_POST in normalization

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information...
mauriciofauth committed Aug 19, 2018
1 parent bf3e6c3 commit 827e4dcf2ce738d7b320682e97e29ad448f9147f
Showing with 26 additions and 26 deletions.
  1. +1 −1 libraries/classes/Normalization.php
  2. +24 −24 normalization.php
  3. +1 −1 test/classes/NormalizationTest.php
@@ -152,7 +152,7 @@ public function getHtmlForCreateNewColumn(
'fields_meta' => null,
'mimework' => $cfgRelation['mimework'],
'content_cells' => $contentCells,
'change_column' => $_REQUEST['change_column'],
'change_column' => $_POST['change_column'],
'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(),
'browse_mime' => $GLOBALS['cfg']['BrowseMIME'],
'server_type' => Util::getServerType(),
@@ -15,7 +15,7 @@
$normalization = new Normalization($GLOBALS['dbi']);
if (isset($_REQUEST['getColumns'])) {
if (isset($_POST['getColumns'])) {
$html = '<option selected disabled>' . __('Select one…') . '</option>'
. '<option value="no_such_col">' . __('No such column') . '</option>';
//get column whose datatype falls under string category
@@ -27,14 +27,14 @@
echo $html;
exit;
}
if (isset($_REQUEST['splitColumn'])) {
$num_fields = min(4096, intval($_REQUEST['numFields']));
if (isset($_POST['splitColumn'])) {
$num_fields = min(4096, intval($_POST['numFields']));
$html = $normalization->getHtmlForCreateNewColumn($num_fields, $db, $table);
$html .= Url::getHiddenInputs($db, $table);
echo $html;
exit;
}
if (isset($_REQUEST['addNewPrimary'])) {
if (isset($_POST['addNewPrimary'])) {
$num_fields = 1;
$columnMeta = array('Field'=>$table . "_id", 'Extra'=>'auto_increment');
$html = $normalization->getHtmlForCreateNewColumn(
@@ -44,24 +44,24 @@
echo $html;
exit;
}
if (isset($_REQUEST['findPdl'])) {
if (isset($_POST['findPdl'])) {
$html = $normalization->findPartialDependencies($table, $db);
echo $html;
exit;
}
if (isset($_REQUEST['getNewTables2NF'])) {
$partialDependencies = json_decode($_REQUEST['pd']);
if (isset($_POST['getNewTables2NF'])) {
$partialDependencies = json_decode($_POST['pd']);
$html = $normalization->getHtmlForNewTables2NF($partialDependencies, $table);
echo $html;
exit;
}
$response = Response::getInstance();
if (isset($_REQUEST['getNewTables3NF'])) {
$dependencies = json_decode($_REQUEST['pd']);
$tables = json_decode($_REQUEST['tables']);
if (isset($_POST['getNewTables3NF'])) {
$dependencies = json_decode($_POST['pd']);
$tables = json_decode($_POST['tables']);
$newTables = $normalization->getHtmlForNewTables3NF($dependencies, $tables, $db);
$response->disable();
Core::headerJSON();
@@ -74,18 +74,18 @@
$scripts->addFile('normalization.js');
$scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
$normalForm = '1nf';
if (Core::isValid($_REQUEST['normalizeTo'], array('1nf', '2nf', '3nf'))) {
$normalForm = $_REQUEST['normalizeTo'];
if (Core::isValid($_POST['normalizeTo'], array('1nf', '2nf', '3nf'))) {
$normalForm = $_POST['normalizeTo'];
}
if (isset($_REQUEST['createNewTables2NF'])) {
$partialDependencies = json_decode($_REQUEST['pd']);
$tablesName = json_decode($_REQUEST['newTablesName']);
if (isset($_POST['createNewTables2NF'])) {
$partialDependencies = json_decode($_POST['pd']);
$tablesName = json_decode($_POST['newTablesName']);
$res = $normalization->createNewTablesFor2NF($partialDependencies, $tablesName, $table, $db);
$response->addJSON($res);
exit;
}
if (isset($_REQUEST['createNewTables3NF'])) {
$newtables = json_decode($_REQUEST['newTables']);
if (isset($_POST['createNewTables3NF'])) {
$newtables = json_decode($_POST['newTables']);
$res = $normalization->createNewTablesFor3NF($newtables, $db);
$response->addJSON($res);
exit;
@@ -101,23 +101,23 @@
$response->addJSON($res);
exit;
}
if (isset($_REQUEST['step1'])) {
if (isset($_POST['step1'])) {
$html = $normalization->getHtmlFor1NFStep1($db, $table, $normalForm);
$response->addHTML($html);
} elseif (isset($_REQUEST['step2'])) {
} elseif (isset($_POST['step2'])) {
$res = $normalization->getHtmlContentsFor1NFStep2($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step3'])) {
} elseif (isset($_POST['step3'])) {
$res = $normalization->getHtmlContentsFor1NFStep3($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step4'])) {
} elseif (isset($_POST['step4'])) {
$res = $normalization->getHtmlContentsFor1NFStep4($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step']) && $_REQUEST['step'] == '2.1') {
} elseif (isset($_POST['step']) && $_POST['step'] == '2.1') {
$res = $normalization->getHtmlFor2NFstep1($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step']) && $_REQUEST['step'] == '3.1') {
$tables = $_REQUEST['tables'];
} elseif (isset($_POST['step']) && $_POST['step'] == '3.1') {
$tables = $_POST['tables'];
$res = $normalization->getHtmlFor3NFstep1($db, $tables);
$response->addJSON($res);
} else {
@@ -41,7 +41,7 @@ public function setUp()
$GLOBALS['table'] = 'PMA_table';
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$_REQUEST['change_column'] = null;
$_POST['change_column'] = null;
//$_SESSION

0 comments on commit 827e4dc

Please sign in to comment.
You can’t perform that action at this time.