Merge pull request #253 from phpmyadmin/request_to_post
This commit is contained in:
commit
7fe8b4c39c
8
ajax.php
8
ajax.php
@ -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);
|
||||
|
||||
@ -14,7 +14,7 @@ use PhpMyAdmin\Util;
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
/**
|
||||
* Sets globals from $_REQUEST
|
||||
* Sets globals from $_POST
|
||||
*/
|
||||
$request_params = array(
|
||||
'data',
|
||||
@ -22,8 +22,8 @@ $request_params = array(
|
||||
);
|
||||
|
||||
foreach ($request_params as $one_request_param) {
|
||||
if (isset($_REQUEST[$one_request_param])) {
|
||||
$GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
|
||||
if (isset($_POST[$one_request_param])) {
|
||||
$GLOBALS[$one_request_param] = $_POST[$one_request_param];
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,13 +49,13 @@ $browseForeigners = new BrowseForeigners(
|
||||
$GLOBALS['pmaThemeImage']
|
||||
);
|
||||
$foreign_limit = $browseForeigners->getForeignLimit(
|
||||
isset($_REQUEST['foreign_showAll']) ? $_REQUEST['foreign_showAll'] : null
|
||||
isset($_POST['foreign_showAll']) ? $_POST['foreign_showAll'] : null
|
||||
);
|
||||
|
||||
$foreignData = $relation->getForeignData(
|
||||
$foreigners, $_REQUEST['field'], true,
|
||||
isset($_REQUEST['foreign_filter'])
|
||||
? $_REQUEST['foreign_filter']
|
||||
$foreigners, $_POST['field'], true,
|
||||
isset($_POST['foreign_filter'])
|
||||
? $_POST['foreign_filter']
|
||||
: '',
|
||||
isset($foreign_limit) ? $foreign_limit : null,
|
||||
true // for getting value in $foreignData['the_total']
|
||||
@ -65,7 +65,7 @@ $foreignData = $relation->getForeignData(
|
||||
$html = $browseForeigners->getHtmlForRelationalFieldSelection(
|
||||
$db,
|
||||
$table,
|
||||
$_REQUEST['field'],
|
||||
$_POST['field'],
|
||||
$foreignData,
|
||||
isset($fieldkey) ? $fieldkey : null,
|
||||
isset($data) ? $data : null
|
||||
|
||||
@ -13,20 +13,20 @@ require_once 'libraries/common.inc.php';
|
||||
$relation = new Relation();
|
||||
|
||||
// If request for creating the pmadb
|
||||
if (isset($_REQUEST['create_pmadb'])) {
|
||||
if (isset($_POST['create_pmadb'])) {
|
||||
if ($relation->createPmaDatabase()) {
|
||||
$relation->fixPmaTables('phpmyadmin');
|
||||
}
|
||||
}
|
||||
|
||||
// If request for creating all PMA tables.
|
||||
if (isset($_REQUEST['fixall_pmadb'])) {
|
||||
if (isset($_POST['fixall_pmadb'])) {
|
||||
$relation->fixPmaTables($GLOBALS['db']);
|
||||
}
|
||||
|
||||
$cfgRelation = $relation->getRelationsParam();
|
||||
// If request for creating missing PMA tables.
|
||||
if (isset($_REQUEST['fix_pmadb'])) {
|
||||
if (isset($_POST['fix_pmadb'])) {
|
||||
$relation->fixPmaTables($cfgRelation['db']);
|
||||
}
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ $pmadb = $cfgCentralColumns['db'];
|
||||
$pmatable = $cfgCentralColumns['table'];
|
||||
$max_rows = intval($GLOBALS['cfg']['MaxRows']);
|
||||
|
||||
if (isset($_REQUEST['edit_central_columns_page'])) {
|
||||
$selected_fld = $_REQUEST['selected_fld'];
|
||||
$selected_db = $_REQUEST['db'];
|
||||
if (isset($_POST['edit_central_columns_page'])) {
|
||||
$selected_fld = $_POST['selected_fld'];
|
||||
$selected_db = $_POST['db'];
|
||||
$edit_central_column_page = $centralColumns->getHtmlForEditingPage(
|
||||
$selected_fld,
|
||||
$selected_db
|
||||
@ -109,15 +109,15 @@ if (isset($_POST['delete_save'])) {
|
||||
false
|
||||
);
|
||||
}
|
||||
if (!empty($_REQUEST['total_rows'])
|
||||
&& Core::isValid($_REQUEST['total_rows'], 'integer')
|
||||
if (!empty($_POST['total_rows'])
|
||||
&& Core::isValid($_POST['total_rows'], 'integer')
|
||||
) {
|
||||
$total_rows = $_REQUEST['total_rows'];
|
||||
$total_rows = $_POST['total_rows'];
|
||||
} else {
|
||||
$total_rows = $centralColumns->getCount($db);
|
||||
}
|
||||
if (Core::isValid($_REQUEST['pos'], 'integer')) {
|
||||
$pos = intval($_REQUEST['pos']);
|
||||
if (Core::isValid($_POST['pos'], 'integer')) {
|
||||
$pos = intval($_POST['pos']);
|
||||
} else {
|
||||
$pos = 0;
|
||||
}
|
||||
|
||||
@ -18,17 +18,17 @@ $designerCommon = new Common();
|
||||
|
||||
if (isset($_REQUEST['dialog'])) {
|
||||
|
||||
if ($_REQUEST['dialog'] == 'edit') {
|
||||
if ($_GET['dialog'] == 'edit') {
|
||||
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage');
|
||||
} elseif ($_REQUEST['dialog'] == 'delete') {
|
||||
} elseif ($_GET['dialog'] == 'delete') {
|
||||
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage');
|
||||
} elseif ($_REQUEST['dialog'] == 'save_as') {
|
||||
} elseif ($_GET['dialog'] == 'save_as') {
|
||||
$html = $databaseDesigner->getHtmlForPageSaveAs($GLOBALS['db']);
|
||||
} elseif ($_REQUEST['dialog'] == 'export') {
|
||||
} elseif ($_GET['dialog'] == 'export') {
|
||||
$html = $databaseDesigner->getHtmlForSchemaExport(
|
||||
$GLOBALS['db'], $_REQUEST['selected_page']
|
||||
$GLOBALS['db'], $_GET['selected_page']
|
||||
);
|
||||
} elseif ($_REQUEST['dialog'] == 'add_table') {
|
||||
} elseif ($_POST['dialog'] == 'add_table') {
|
||||
$script_display_field = $designerCommon->getTablesInfo();
|
||||
$required = $GLOBALS['db'] . '.' . $GLOBALS['table'];
|
||||
$tab_column = $designerCommon->getColumnsInfo();
|
||||
@ -56,50 +56,50 @@ if (isset($_REQUEST['dialog'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['operation'])) {
|
||||
if (isset($_POST['operation'])) {
|
||||
|
||||
if ($_REQUEST['operation'] == 'deletePage') {
|
||||
$success = $designerCommon->deletePage($_REQUEST['selected_page']);
|
||||
if ($_POST['operation'] == 'deletePage') {
|
||||
$success = $designerCommon->deletePage($_POST['selected_page']);
|
||||
$response->setRequestStatus($success);
|
||||
} elseif ($_REQUEST['operation'] == 'savePage') {
|
||||
if ($_REQUEST['save_page'] == 'same') {
|
||||
$page = $_REQUEST['selected_page'];
|
||||
} elseif ($_POST['operation'] == 'savePage') {
|
||||
if ($_POST['save_page'] == 'same') {
|
||||
$page = $_POST['selected_page'];
|
||||
} else { // new
|
||||
$page = $designerCommon->createNewPage($_REQUEST['selected_value'], $GLOBALS['db']);
|
||||
$page = $designerCommon->createNewPage($_POST['selected_value'], $GLOBALS['db']);
|
||||
$response->addJSON('id', $page);
|
||||
}
|
||||
$success = $designerCommon->saveTablePositions($page);
|
||||
$response->setRequestStatus($success);
|
||||
} elseif ($_REQUEST['operation'] == 'setDisplayField') {
|
||||
} elseif ($_POST['operation'] == 'setDisplayField') {
|
||||
$designerCommon->saveDisplayField(
|
||||
$_REQUEST['db'], $_REQUEST['table'], $_REQUEST['field']
|
||||
$_POST['db'], $_POST['table'], $_POST['field']
|
||||
);
|
||||
$response->setRequestStatus(true);
|
||||
} elseif ($_REQUEST['operation'] == 'addNewRelation') {
|
||||
} elseif ($_POST['operation'] == 'addNewRelation') {
|
||||
list($success, $message) = $designerCommon->addNewRelation(
|
||||
$_REQUEST['db'],
|
||||
$_REQUEST['T1'],
|
||||
$_REQUEST['F1'],
|
||||
$_REQUEST['T2'],
|
||||
$_REQUEST['F2'],
|
||||
$_REQUEST['on_delete'],
|
||||
$_REQUEST['on_update'],
|
||||
$_REQUEST['DB1'],
|
||||
$_REQUEST['DB2']
|
||||
$_POST['db'],
|
||||
$_POST['T1'],
|
||||
$_POST['F1'],
|
||||
$_POST['T2'],
|
||||
$_POST['F2'],
|
||||
$_POST['on_delete'],
|
||||
$_POST['on_update'],
|
||||
$_POST['DB1'],
|
||||
$_POST['DB2']
|
||||
);
|
||||
$response->setRequestStatus($success);
|
||||
$response->addJSON('message', $message);
|
||||
} elseif ($_REQUEST['operation'] == 'removeRelation') {
|
||||
} elseif ($_POST['operation'] == 'removeRelation') {
|
||||
list($success, $message) = $designerCommon->removeRelation(
|
||||
$_REQUEST['T1'],
|
||||
$_REQUEST['F1'],
|
||||
$_REQUEST['T2'],
|
||||
$_REQUEST['F2']
|
||||
$_POST['T1'],
|
||||
$_POST['F1'],
|
||||
$_POST['T2'],
|
||||
$_POST['F2']
|
||||
);
|
||||
$response->setRequestStatus($success);
|
||||
$response->addJSON('message', $message);
|
||||
} elseif ($_REQUEST['operation'] == 'save_setting_value') {
|
||||
$success = $designerCommon->saveSetting($_REQUEST['index'], $_REQUEST['value']);
|
||||
} elseif ($_POST['operation'] == 'save_setting_value') {
|
||||
$success = $designerCommon->saveSetting($_POST['index'], $_POST['value']);
|
||||
$response->setRequestStatus($success);
|
||||
}
|
||||
|
||||
@ -118,13 +118,13 @@ $classes_side_menu = $databaseDesigner->returnClassNamesFromMenuButtons();
|
||||
$display_page = -1;
|
||||
$selected_page = null;
|
||||
|
||||
if (isset($_REQUEST['query'])) {
|
||||
$display_page = $designerCommon->getDefaultPage($_REQUEST['db']);
|
||||
if (isset($_GET['query'])) {
|
||||
$display_page = $designerCommon->getDefaultPage($_GET['db']);
|
||||
} else {
|
||||
if (! empty($_REQUEST['page'])) {
|
||||
$display_page = $_REQUEST['page'];
|
||||
if (! empty($_GET['page'])) {
|
||||
$display_page = $_GET['page'];
|
||||
} else {
|
||||
$display_page = $designerCommon->getLoadingPage($_REQUEST['db']);
|
||||
$display_page = $designerCommon->getLoadingPage($_GET['db']);
|
||||
}
|
||||
}
|
||||
if ($display_page != -1) {
|
||||
@ -173,7 +173,7 @@ $response->addHTML(
|
||||
);
|
||||
$response->addHTML(
|
||||
$databaseDesigner->getPageMenu(
|
||||
isset($_REQUEST['query']),
|
||||
isset($_GET['query']),
|
||||
$selected_page,
|
||||
$classes_side_menu
|
||||
)
|
||||
@ -203,7 +203,7 @@ $response->addHTML('<div id="designer_hint"></div>');
|
||||
$response->addHTML($databaseDesigner->getNewRelationPanel());
|
||||
$response->addHTML($databaseDesigner->getDeleteRelationPanel());
|
||||
|
||||
if (isset($_REQUEST['query'])) {
|
||||
if (isset($_GET['query'])) {
|
||||
$response->addHTML($databaseDesigner->getOptionsPanel());
|
||||
$response->addHTML($databaseDesigner->getRenameToPanel());
|
||||
$response->addHTML($databaseDesigner->getHavingQueryPanel());
|
||||
|
||||
@ -56,8 +56,8 @@ if ($num_tables < 1) {
|
||||
} // end if
|
||||
|
||||
$multi_values = '<div class="export_table_list_container">';
|
||||
if (isset($_GET['structure_or_data_forced'])) {
|
||||
$force_val = htmlspecialchars($_GET['structure_or_data_forced']);
|
||||
if (isset($_POST['structure_or_data_forced'])) {
|
||||
$force_val = htmlspecialchars($_POST['structure_or_data_forced']);
|
||||
} else {
|
||||
$force_val = 0;
|
||||
}
|
||||
@ -84,19 +84,19 @@ if (!empty($_POST['selected_tbl']) && empty($table_select)) {
|
||||
$table_select = $_POST['selected_tbl'];
|
||||
}
|
||||
|
||||
// Check if the selected tables are defined in $_GET
|
||||
// Check if the selected tables are defined in $_POST
|
||||
// (from clicking Back button on export.php)
|
||||
foreach (array('table_select', 'table_structure', 'table_data') as $one_key) {
|
||||
if (isset($_GET[$one_key])) {
|
||||
$_GET[$one_key] = urldecode($_GET[$one_key]);
|
||||
$_GET[$one_key] = explode(",", $_GET[$one_key]);
|
||||
if (isset($_POST[$one_key])) {
|
||||
$_POST[$one_key] = urldecode($_POST[$one_key]);
|
||||
$_POST[$one_key] = explode(",", $_POST[$one_key]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($tables as $each_table) {
|
||||
if (isset($_GET['table_select']) && is_array($_GET['table_select'])) {
|
||||
if (isset($_POST['table_select']) && is_array($_POST['table_select'])) {
|
||||
$is_checked = Export::getCheckedClause(
|
||||
$each_table['Name'], $_GET['table_select']
|
||||
$each_table['Name'], $_POST['table_select']
|
||||
);
|
||||
} elseif (isset($table_select)) {
|
||||
$is_checked = Export::getCheckedClause(
|
||||
@ -105,16 +105,16 @@ foreach ($tables as $each_table) {
|
||||
} else {
|
||||
$is_checked = ' checked="checked"';
|
||||
}
|
||||
if (isset($_GET['table_structure']) && is_array($_GET['table_structure'])) {
|
||||
if (isset($_POST['table_structure']) && is_array($_POST['table_structure'])) {
|
||||
$structure_checked = Export::getCheckedClause(
|
||||
$each_table['Name'], $_GET['table_structure']
|
||||
$each_table['Name'], $_POST['table_structure']
|
||||
);
|
||||
} else {
|
||||
$structure_checked = $is_checked;
|
||||
}
|
||||
if (isset($_GET['table_data']) && is_array($_GET['table_data'])) {
|
||||
if (isset($_POST['table_data']) && is_array($_POST['table_data'])) {
|
||||
$data_checked = Export::getCheckedClause(
|
||||
$each_table['Name'], $_GET['table_data']
|
||||
$each_table['Name'], $_POST['table_data']
|
||||
);
|
||||
} else {
|
||||
$data_checked = $is_checked;
|
||||
|
||||
@ -46,31 +46,31 @@ $operations = new Operations();
|
||||
* Rename/move or copy database
|
||||
*/
|
||||
if (strlen($GLOBALS['db']) > 0
|
||||
&& (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
|
||||
&& (! empty($_POST['db_rename']) || ! empty($_POST['db_copy']))
|
||||
) {
|
||||
if (! empty($_REQUEST['db_rename'])) {
|
||||
if (! empty($_POST['db_rename'])) {
|
||||
$move = true;
|
||||
} else {
|
||||
$move = false;
|
||||
}
|
||||
|
||||
if (! isset($_REQUEST['newname']) || strlen($_REQUEST['newname']) === 0) {
|
||||
if (! isset($_POST['newname']) || strlen($_POST['newname']) === 0) {
|
||||
$message = Message::error(__('The database name is empty!'));
|
||||
} else {
|
||||
// lower_case_table_names=1 `DB` becomes `db`
|
||||
if ($GLOBALS['dbi']->getLowerCaseNames() === '1') {
|
||||
$_REQUEST['newname'] = mb_strtolower(
|
||||
$_REQUEST['newname']
|
||||
$_POST['newname'] = mb_strtolower(
|
||||
$_POST['newname']
|
||||
);
|
||||
}
|
||||
|
||||
if ($_REQUEST['newname'] === $_REQUEST['db']) {
|
||||
if ($_POST['newname'] === $_REQUEST['db']) {
|
||||
$message = Message::error(
|
||||
__('Cannot copy database to the same name. Change the name and try again.')
|
||||
);
|
||||
} else {
|
||||
$_error = false;
|
||||
if ($move || ! empty($_REQUEST['create_database_before_copying'])) {
|
||||
if ($move || ! empty($_POST['create_database_before_copying'])) {
|
||||
$operations->createDbBeforeCopy();
|
||||
}
|
||||
|
||||
@ -135,10 +135,10 @@ if (strlen($GLOBALS['db']) > 0
|
||||
$operations->duplicateBookmarks($_error, $GLOBALS['db']);
|
||||
|
||||
if (! $_error && $move) {
|
||||
if (isset($_REQUEST['adjust_privileges'])
|
||||
&& ! empty($_REQUEST['adjust_privileges'])
|
||||
if (isset($_POST['adjust_privileges'])
|
||||
&& ! empty($_POST['adjust_privileges'])
|
||||
) {
|
||||
$operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_REQUEST['newname']);
|
||||
$operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_POST['newname']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -156,19 +156,19 @@ if (strlen($GLOBALS['db']) > 0
|
||||
__('Database %1$s has been renamed to %2$s.')
|
||||
);
|
||||
$message->addParam($GLOBALS['db']);
|
||||
$message->addParam($_REQUEST['newname']);
|
||||
$message->addParam($_POST['newname']);
|
||||
} elseif (! $_error) {
|
||||
if (isset($_REQUEST['adjust_privileges'])
|
||||
&& ! empty($_REQUEST['adjust_privileges'])
|
||||
if (isset($_POST['adjust_privileges'])
|
||||
&& ! empty($_POST['adjust_privileges'])
|
||||
) {
|
||||
$operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_REQUEST['newname']);
|
||||
$operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_POST['newname']);
|
||||
}
|
||||
|
||||
$message = Message::success(
|
||||
__('Database %1$s has been copied to %2$s.')
|
||||
);
|
||||
$message->addParam($GLOBALS['db']);
|
||||
$message->addParam($_REQUEST['newname']);
|
||||
$message->addParam($_POST['newname']);
|
||||
} else {
|
||||
$message = Message::error();
|
||||
}
|
||||
@ -176,13 +176,13 @@ if (strlen($GLOBALS['db']) > 0
|
||||
|
||||
/* Change database to be used */
|
||||
if (! $_error && $move) {
|
||||
$GLOBALS['db'] = $_REQUEST['newname'];
|
||||
$GLOBALS['db'] = $_POST['newname'];
|
||||
} elseif (! $_error) {
|
||||
if (isset($_REQUEST['switch_to_new'])
|
||||
&& $_REQUEST['switch_to_new'] == 'true'
|
||||
if (isset($_POST['switch_to_new'])
|
||||
&& $_POST['switch_to_new'] == 'true'
|
||||
) {
|
||||
$_SESSION['pma_switch_to_new'] = true;
|
||||
$GLOBALS['db'] = $_REQUEST['newname'];
|
||||
$GLOBALS['db'] = $_POST['newname'];
|
||||
} else {
|
||||
$_SESSION['pma_switch_to_new'] = false;
|
||||
}
|
||||
@ -197,7 +197,7 @@ if (strlen($GLOBALS['db']) > 0
|
||||
if ($response->isAjax()) {
|
||||
$response->setRequestStatus($message->isSuccess());
|
||||
$response->addJSON('message', $message);
|
||||
$response->addJSON('newname', $_REQUEST['newname']);
|
||||
$response->addJSON('newname', $_POST['newname']);
|
||||
$response->addJSON(
|
||||
'sql_query',
|
||||
Util::getMessage(null, $sql_query)
|
||||
@ -218,8 +218,8 @@ $cfgRelation = $relation->getRelationsParam();
|
||||
* Check if comments were updated
|
||||
* (must be done before displaying the menu tabs)
|
||||
*/
|
||||
if (isset($_REQUEST['comment'])) {
|
||||
$relation->setDbComment($GLOBALS['db'], $_REQUEST['comment']);
|
||||
if (isset($_POST['comment'])) {
|
||||
$relation->setDbComment($GLOBALS['db'], $_POST['comment']);
|
||||
}
|
||||
|
||||
require 'libraries/db_common.inc.php';
|
||||
@ -247,7 +247,7 @@ if (isset($message)) {
|
||||
unset($message);
|
||||
}
|
||||
|
||||
$_REQUEST['db_collation'] = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']);
|
||||
$db_collation = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']);
|
||||
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);
|
||||
|
||||
if (!$is_information_schema) {
|
||||
@ -266,7 +266,7 @@ if (!$is_information_schema) {
|
||||
* rename database
|
||||
*/
|
||||
if ($GLOBALS['db'] != 'mysql') {
|
||||
$response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db']));
|
||||
$response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db'], $db_collation));
|
||||
}
|
||||
|
||||
// Drop link if allowed
|
||||
@ -282,12 +282,12 @@ if (!$is_information_schema) {
|
||||
/**
|
||||
* Copy database
|
||||
*/
|
||||
$response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db']));
|
||||
$response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db'], $db_collation));
|
||||
|
||||
/**
|
||||
* Change database charset
|
||||
*/
|
||||
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table));
|
||||
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $db_collation));
|
||||
|
||||
if (! $cfgRelation['allworks']
|
||||
&& $cfg['PmaNoRelation_DisableWarning'] == false
|
||||
@ -298,7 +298,7 @@ if (!$is_information_schema) {
|
||||
'%sFind out why%s.'
|
||||
)
|
||||
);
|
||||
$message->addParamHtml('<a href="./chk_rel.php' . $url_query . '">');
|
||||
$message->addParamHtml('<a href="./chk_rel.php" data-post="' . $url_query . '">');
|
||||
$message->addParamHtml('</a>');
|
||||
/* Show error if user has configured something, notice elsewhere */
|
||||
if (!empty($cfg['Servers'][$server]['pmadb'])) {
|
||||
|
||||
36
db_qbe.php
36
db_qbe.php
@ -37,36 +37,36 @@ if ($cfgRelation['savedsearcheswork']) {
|
||||
//Get saved search list.
|
||||
$savedSearch = new SavedSearches($GLOBALS);
|
||||
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
|
||||
->setDbname($_REQUEST['db']);
|
||||
->setDbname($GLOBALS['db']);
|
||||
|
||||
if (!empty($_REQUEST['searchId'])) {
|
||||
$savedSearch->setId($_REQUEST['searchId']);
|
||||
if (!empty($_POST['searchId'])) {
|
||||
$savedSearch->setId($_POST['searchId']);
|
||||
}
|
||||
|
||||
//Action field is sent.
|
||||
if (isset($_REQUEST['action'])) {
|
||||
$savedSearch->setSearchName($_REQUEST['searchName']);
|
||||
if ('create' === $_REQUEST['action']) {
|
||||
if (isset($_POST['action'])) {
|
||||
$savedSearch->setSearchName($_POST['searchName']);
|
||||
if ('create' === $_POST['action']) {
|
||||
$saveResult = $savedSearch->setId(null)
|
||||
->setCriterias($_REQUEST)
|
||||
->setCriterias($_POST)
|
||||
->save();
|
||||
} elseif ('update' === $_REQUEST['action']) {
|
||||
$saveResult = $savedSearch->setCriterias($_REQUEST)
|
||||
} elseif ('update' === $_POST['action']) {
|
||||
$saveResult = $savedSearch->setCriterias($_POST)
|
||||
->save();
|
||||
} elseif ('delete' === $_REQUEST['action']) {
|
||||
} elseif ('delete' === $_POST['action']) {
|
||||
$deleteResult = $savedSearch->delete();
|
||||
//After deletion, reset search.
|
||||
$savedSearch = new SavedSearches($GLOBALS);
|
||||
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
|
||||
->setDbname($_REQUEST['db']);
|
||||
$_REQUEST = array();
|
||||
} elseif ('load' === $_REQUEST['action']) {
|
||||
if (empty($_REQUEST['searchId'])) {
|
||||
->setDbname($GLOBALS['db']);
|
||||
$_POST = array();
|
||||
} elseif ('load' === $_POST['action']) {
|
||||
if (empty($_POST['searchId'])) {
|
||||
//when not loading a search, reset the object.
|
||||
$savedSearch = new SavedSearches($GLOBALS);
|
||||
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
|
||||
->setDbname($_REQUEST['db']);
|
||||
$_REQUEST = array();
|
||||
->setDbname($GLOBALS['db']);
|
||||
$_POST = array();
|
||||
} else {
|
||||
$loadResult = $savedSearch->load();
|
||||
}
|
||||
@ -82,7 +82,7 @@ if ($cfgRelation['savedsearcheswork']) {
|
||||
* A query has been submitted -> (maybe) execute it
|
||||
*/
|
||||
$message_to_display = false;
|
||||
if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
|
||||
if (isset($_POST['submit_sql']) && ! empty($sql_query)) {
|
||||
if (! preg_match('@^SELECT@i', $sql_query)) {
|
||||
$message_to_display = true;
|
||||
} else {
|
||||
@ -91,7 +91,7 @@ if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
|
||||
$sql->executeQueryAndSendQueryResponse(
|
||||
null, // analyzed_sql_results
|
||||
false, // is_gotofile
|
||||
$_REQUEST['db'], // db
|
||||
$_POST['db'], // db
|
||||
null, // table
|
||||
false, // find_real_end
|
||||
null, // sql_query_for_bookmark
|
||||
|
||||
@ -54,7 +54,7 @@ if (! $response->isAjax()) {
|
||||
}
|
||||
|
||||
// Main search form has been submitted, get results
|
||||
if (isset($_REQUEST['submit_search'])) {
|
||||
if (isset($_POST['submit_search'])) {
|
||||
$response->addHTML($db_search->getSearchResults());
|
||||
}
|
||||
|
||||
|
||||
@ -39,8 +39,8 @@ $back = 'db_sql.php';
|
||||
$response->addHTML(
|
||||
SqlQueryForm::getHtml(
|
||||
true, false,
|
||||
isset($_REQUEST['delimiter'])
|
||||
? htmlspecialchars($_REQUEST['delimiter'])
|
||||
isset($_POST['delimiter'])
|
||||
? htmlspecialchars($_POST['delimiter'])
|
||||
: ';'
|
||||
)
|
||||
);
|
||||
|
||||
@ -30,6 +30,8 @@ $scripts->addFile('db_tracking.js');
|
||||
*/
|
||||
require 'libraries/db_common.inc.php';
|
||||
$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
|
||||
$url_params['goto'] = 'tbl_tracking.php';
|
||||
$url_params['back'] = 'db_tracking.php';
|
||||
|
||||
// Get the database structure
|
||||
$sub_part = '_structure';
|
||||
@ -46,47 +48,45 @@ list(
|
||||
$pos
|
||||
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
|
||||
|
||||
// Work to do?
|
||||
// (here, do not use $_REQUEST['db] as it can be crafted)
|
||||
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
|
||||
if (isset($_POST['delete_tracking']) && isset($_POST['table'])) {
|
||||
|
||||
Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
|
||||
Tracker::deleteTracking($GLOBALS['db'], $_POST['table']);
|
||||
Message::success(
|
||||
__('Tracking data deleted successfully.')
|
||||
)->display();
|
||||
|
||||
} elseif (isset($_REQUEST['submit_create_version'])) {
|
||||
} elseif (isset($_POST['submit_create_version'])) {
|
||||
|
||||
Tracking::createTrackingForMultipleTables($_REQUEST['selected']);
|
||||
Tracking::createTrackingForMultipleTables($_POST['selected']);
|
||||
Message::success(
|
||||
sprintf(
|
||||
__(
|
||||
'Version %1$s was created for selected tables,'
|
||||
. ' tracking is active for them.'
|
||||
),
|
||||
htmlspecialchars($_REQUEST['version'])
|
||||
htmlspecialchars($_POST['version'])
|
||||
)
|
||||
)->display();
|
||||
|
||||
} elseif (isset($_REQUEST['submit_mult'])) {
|
||||
} elseif (isset($_POST['submit_mult'])) {
|
||||
|
||||
if (! empty($_REQUEST['selected_tbl'])) {
|
||||
if ($_REQUEST['submit_mult'] == 'delete_tracking') {
|
||||
if (! empty($_POST['selected_tbl'])) {
|
||||
if ($_POST['submit_mult'] == 'delete_tracking') {
|
||||
|
||||
foreach ($_REQUEST['selected_tbl'] as $table) {
|
||||
foreach ($_POST['selected_tbl'] as $table) {
|
||||
Tracker::deleteTracking($GLOBALS['db'], $table);
|
||||
}
|
||||
Message::success(
|
||||
__('Tracking data deleted successfully.')
|
||||
)->display();
|
||||
|
||||
} elseif ($_REQUEST['submit_mult'] == 'track') {
|
||||
} elseif ($_POST['submit_mult'] == 'track') {
|
||||
|
||||
echo Tracking::getHtmlForDataDefinitionAndManipulationStatements(
|
||||
'db_tracking.php' . $url_query,
|
||||
0,
|
||||
$GLOBALS['db'],
|
||||
$_REQUEST['selected_tbl']
|
||||
$_POST['selected_tbl']
|
||||
);
|
||||
exit;
|
||||
}
|
||||
@ -98,7 +98,7 @@ if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
|
||||
}
|
||||
|
||||
// Get tracked data about the database
|
||||
$data = Tracker::getTrackedData($_REQUEST['db'], '', '1');
|
||||
$data = Tracker::getTrackedData($GLOBALS['db'], '', '1');
|
||||
|
||||
// No tables present and no log exist
|
||||
if ($num_tables == 0 && count($data['ddlog']) == 0) {
|
||||
@ -118,7 +118,7 @@ $cfgRelation = $relation->getRelationsParam();
|
||||
$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' .
|
||||
Util::backquote($cfgRelation['db']) . '.' .
|
||||
Util::backquote($cfgRelation['tracking']) .
|
||||
' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['db']) .
|
||||
' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($GLOBALS['db']) .
|
||||
'\' ' .
|
||||
' GROUP BY table_name' .
|
||||
' ORDER BY table_name ASC';
|
||||
|
||||
@ -13,8 +13,8 @@ use PhpMyAdmin\Utils\HttpRequest;
|
||||
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
if (!isset($_REQUEST['exception_type'])
|
||||
||!in_array($_REQUEST['exception_type'], array('js', 'php'))
|
||||
if (!isset($_POST['exception_type'])
|
||||
||!in_array($_POST['exception_type'], array('js', 'php'))
|
||||
) {
|
||||
die('Oops, something went wrong!!');
|
||||
}
|
||||
@ -23,11 +23,11 @@ $response = Response::getInstance();
|
||||
|
||||
$errorReport = new ErrorReport(new HttpRequest());
|
||||
|
||||
if (isset($_REQUEST['send_error_report'])
|
||||
&& ($_REQUEST['send_error_report'] == true
|
||||
|| $_REQUEST['send_error_report'] == '1')
|
||||
if (isset($_POST['send_error_report'])
|
||||
&& ($_POST['send_error_report'] == true
|
||||
|| $_POST['send_error_report'] == '1')
|
||||
) {
|
||||
if ($_REQUEST['exception_type'] == 'php') {
|
||||
if ($_POST['exception_type'] == 'php') {
|
||||
/**
|
||||
* Prevent infinite error submission.
|
||||
* Happens in case error submissions fails.
|
||||
@ -51,7 +51,7 @@ if (isset($_REQUEST['send_error_report'])
|
||||
);
|
||||
}
|
||||
}
|
||||
$reportData = $errorReport->getData($_REQUEST['exception_type']);
|
||||
$reportData = $errorReport->getData($_POST['exception_type']);
|
||||
// report if and only if there were 'actual' errors.
|
||||
if (count($reportData) > 0) {
|
||||
$server_response = $errorReport->send($reportData);
|
||||
@ -65,8 +65,8 @@ if (isset($_REQUEST['send_error_report'])
|
||||
|
||||
/* Message to show to the user */
|
||||
if ($success) {
|
||||
if ((isset($_REQUEST['automatic'])
|
||||
&& $_REQUEST['automatic'] === "true")
|
||||
if ((isset($_POST['automatic'])
|
||||
&& $_POST['automatic'] === "true")
|
||||
|| $GLOBALS['cfg']['SendErrorReports'] == 'always'
|
||||
) {
|
||||
$msg = __(
|
||||
@ -98,35 +98,35 @@ if (isset($_REQUEST['send_error_report'])
|
||||
|
||||
/* Add message to response */
|
||||
if ($response->isAjax()) {
|
||||
if ($_REQUEST['exception_type'] == 'js') {
|
||||
if ($_POST['exception_type'] == 'js') {
|
||||
$response->addJSON('message', $msg);
|
||||
} else {
|
||||
$response->addJSON('_errSubmitMsg', $msg);
|
||||
}
|
||||
} elseif ($_REQUEST['exception_type'] == 'php') {
|
||||
} elseif ($_POST['exception_type'] == 'php') {
|
||||
$jsCode = 'PMA_ajaxShowMessage("<div class=\"error\">'
|
||||
. $msg
|
||||
. '</div>", false);';
|
||||
$response->getFooter()->getScripts()->addCode($jsCode);
|
||||
}
|
||||
|
||||
if ($_REQUEST['exception_type'] == 'php') {
|
||||
if ($_POST['exception_type'] == 'php') {
|
||||
// clear previous errors & save new ones.
|
||||
$GLOBALS['error_handler']->savePreviousErrors();
|
||||
}
|
||||
|
||||
/* Persist always send settings */
|
||||
if (isset($_REQUEST['always_send'])
|
||||
&& $_REQUEST['always_send'] === "true"
|
||||
if (isset($_POST['always_send'])
|
||||
&& $_POST['always_send'] === "true"
|
||||
) {
|
||||
$userPreferences = new UserPreferences();
|
||||
$userPreferences->persistOption("SendErrorReports", "always", "ask");
|
||||
}
|
||||
}
|
||||
} elseif (! empty($_REQUEST['get_settings'])) {
|
||||
} elseif (! empty($_POST['get_settings'])) {
|
||||
$response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
|
||||
} else {
|
||||
if ($_REQUEST['exception_type'] == 'js') {
|
||||
if ($_POST['exception_type'] == 'js') {
|
||||
$response->addHTML($errorReport->getForm());
|
||||
} else {
|
||||
// clear previous errors & save new ones.
|
||||
|
||||
38
export.php
38
export.php
@ -227,39 +227,39 @@ $filename = '';
|
||||
$separate_files = '';
|
||||
|
||||
// Is it a quick or custom export?
|
||||
if (isset($_REQUEST['quick_or_custom'])
|
||||
&& $_REQUEST['quick_or_custom'] == 'quick'
|
||||
if (isset($_POST['quick_or_custom'])
|
||||
&& $_POST['quick_or_custom'] == 'quick'
|
||||
) {
|
||||
$quick_export = true;
|
||||
} else {
|
||||
$quick_export = false;
|
||||
}
|
||||
|
||||
if ($_REQUEST['output_format'] == 'astext') {
|
||||
if ($_POST['output_format'] == 'astext') {
|
||||
$asfile = false;
|
||||
} else {
|
||||
$asfile = true;
|
||||
if (isset($_REQUEST['as_separate_files'])
|
||||
&& ! empty($_REQUEST['as_separate_files'])
|
||||
if (isset($_POST['as_separate_files'])
|
||||
&& ! empty($_POST['as_separate_files'])
|
||||
) {
|
||||
if (isset($_REQUEST['compression'])
|
||||
&& ! empty($_REQUEST['compression'])
|
||||
&& $_REQUEST['compression'] == 'zip'
|
||||
if (isset($_POST['compression'])
|
||||
&& ! empty($_POST['compression'])
|
||||
&& $_POST['compression'] == 'zip'
|
||||
) {
|
||||
$separate_files = $_REQUEST['as_separate_files'];
|
||||
$separate_files = $_POST['as_separate_files'];
|
||||
}
|
||||
}
|
||||
if (in_array($_REQUEST['compression'], $compression_methods)) {
|
||||
$compression = $_REQUEST['compression'];
|
||||
if (in_array($_POST['compression'], $compression_methods)) {
|
||||
$compression = $_POST['compression'];
|
||||
$buffer_needed = true;
|
||||
}
|
||||
if (($quick_export && ! empty($_REQUEST['quick_export_onserver']))
|
||||
|| (! $quick_export && ! empty($_REQUEST['onserver']))
|
||||
if (($quick_export && ! empty($_POST['quick_export_onserver']))
|
||||
|| (! $quick_export && ! empty($_POST['onserver']))
|
||||
) {
|
||||
if ($quick_export) {
|
||||
$onserver = $_REQUEST['quick_export_onserver'];
|
||||
$onserver = $_POST['quick_export_onserver'];
|
||||
} else {
|
||||
$onserver = $_REQUEST['onserver'];
|
||||
$onserver = $_POST['onserver'];
|
||||
}
|
||||
// Will we save dump on server?
|
||||
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
|
||||
@ -297,9 +297,9 @@ if ((!empty($parser->statements[0]))
|
||||
) {
|
||||
$aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);
|
||||
}
|
||||
if (!empty($_REQUEST['aliases'])) {
|
||||
$aliases = Export::mergeAliases($aliases, $_REQUEST['aliases']);
|
||||
$_SESSION['tmpval']['aliases'] = $_REQUEST['aliases'];
|
||||
if (!empty($_POST['aliases'])) {
|
||||
$aliases = Export::mergeAliases($aliases, $_POST['aliases']);
|
||||
$_SESSION['tmpval']['aliases'] = $_POST['aliases'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -446,7 +446,7 @@ do {
|
||||
if (!isset($table_data) || !is_array($table_data)) {
|
||||
$table_data = array();
|
||||
}
|
||||
if (!empty($_REQUEST['structure_or_data_forced'])) {
|
||||
if (!empty($_POST['structure_or_data_forced'])) {
|
||||
$table_structure = $tables;
|
||||
$table_data = $tables;
|
||||
}
|
||||
|
||||
@ -27,14 +27,14 @@ function escape($variable)
|
||||
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
if (! isset($_REQUEST['field'])) {
|
||||
if (! isset($_POST['field'])) {
|
||||
PhpMyAdmin\Util::checkParameters(array('field'));
|
||||
}
|
||||
|
||||
// Get data if any posted
|
||||
$gis_data = array();
|
||||
if (Core::isValid($_REQUEST['gis_data'], 'array')) {
|
||||
$gis_data = $_REQUEST['gis_data'];
|
||||
if (Core::isValid($_POST['gis_data'], 'array')) {
|
||||
$gis_data = $_POST['gis_data'];
|
||||
}
|
||||
|
||||
$gis_types = array(
|
||||
@ -50,15 +50,15 @@ $gis_types = array(
|
||||
// Extract type from the initial call and make sure that it's a valid one.
|
||||
// Extract from field's values if available, if not use the column type passed.
|
||||
if (! isset($gis_data['gis_type'])) {
|
||||
if (isset($_REQUEST['type']) && $_REQUEST['type'] != '') {
|
||||
$gis_data['gis_type'] = mb_strtoupper($_REQUEST['type']);
|
||||
if (isset($_POST['type']) && $_POST['type'] != '') {
|
||||
$gis_data['gis_type'] = mb_strtoupper($_POST['type']);
|
||||
}
|
||||
if (isset($_REQUEST['value']) && trim($_REQUEST['value']) != '') {
|
||||
$start = (substr($_REQUEST['value'], 0, 1) == "'") ? 1 : 0;
|
||||
if (isset($_POST['value']) && trim($_POST['value']) != '') {
|
||||
$start = (substr($_POST['value'], 0, 1) == "'") ? 1 : 0;
|
||||
$gis_data['gis_type'] = mb_substr(
|
||||
$_REQUEST['value'],
|
||||
$_POST['value'],
|
||||
$start,
|
||||
mb_strpos($_REQUEST['value'], "(") - $start
|
||||
mb_strpos($_POST['value'], "(") - $start
|
||||
);
|
||||
}
|
||||
if ((! isset($gis_data['gis_type']))
|
||||
@ -71,9 +71,9 @@ $geom_type = htmlspecialchars($gis_data['gis_type']);
|
||||
|
||||
// Generate parameters from value passed.
|
||||
$gis_obj = GisFactory::factory($geom_type);
|
||||
if (isset($_REQUEST['value'])) {
|
||||
if (isset($_POST['value'])) {
|
||||
$gis_data = array_merge(
|
||||
$gis_data, $gis_obj->generateParams($_REQUEST['value'])
|
||||
$gis_data, $gis_obj->generateParams($_POST['value'])
|
||||
);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ $open_layers = GisVisualization::getByData($data, $visualizationSettings)
|
||||
->asOl();
|
||||
|
||||
// If the call is to update the WKT and visualization make an AJAX response
|
||||
if (isset($_REQUEST['generate']) && $_REQUEST['generate'] == true) {
|
||||
if (isset($_POST['generate']) && $_POST['generate'] == true) {
|
||||
$extra_data = array(
|
||||
'result' => $result,
|
||||
'visualization' => $visualization,
|
||||
@ -119,17 +119,17 @@ echo '<div id="gis_data_editor">';
|
||||
echo '<h3>';
|
||||
printf(
|
||||
__('Value for the column "%s"'),
|
||||
htmlspecialchars($_REQUEST['field'])
|
||||
htmlspecialchars($_POST['field'])
|
||||
);
|
||||
echo '</h3>';
|
||||
|
||||
echo '<input type="hidden" name="field" value="'
|
||||
, htmlspecialchars($_REQUEST['field']) , '" />';
|
||||
, htmlspecialchars($_POST['field']) , '" />';
|
||||
// The input field to which the final result should be added
|
||||
// and corresponding null checkbox
|
||||
if (isset($_REQUEST['input_name'])) {
|
||||
if (isset($_POST['input_name'])) {
|
||||
echo '<input type="hidden" name="input_name" value="'
|
||||
, htmlspecialchars($_REQUEST['input_name']) , '" />';
|
||||
, htmlspecialchars($_POST['input_name']) , '" />';
|
||||
}
|
||||
echo Url::getHiddenInputs();
|
||||
|
||||
|
||||
58
import.php
58
import.php
@ -29,12 +29,12 @@ if (isset($_POST['format']) && $_POST['format'] == 'ldi') {
|
||||
*/
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
if (isset($_REQUEST['show_as_php'])) {
|
||||
$GLOBALS['show_as_php'] = $_REQUEST['show_as_php'];
|
||||
if (isset($_POST['show_as_php'])) {
|
||||
$GLOBALS['show_as_php'] = $_POST['show_as_php'];
|
||||
}
|
||||
|
||||
// If there is a request to 'Simulate DML'.
|
||||
if (isset($_REQUEST['simulate_dml'])) {
|
||||
if (isset($_POST['simulate_dml'])) {
|
||||
Import::handleSimulateDmlRequest();
|
||||
exit;
|
||||
}
|
||||
@ -44,25 +44,25 @@ $response = Response::getInstance();
|
||||
$sql = new Sql();
|
||||
|
||||
// If it's a refresh console bookmarks request
|
||||
if (isset($_REQUEST['console_bookmark_refresh'])) {
|
||||
if (isset($_GET['console_bookmark_refresh'])) {
|
||||
$response->addJSON(
|
||||
'console_message_bookmark', PhpMyAdmin\Console::getBookmarkContent()
|
||||
);
|
||||
exit;
|
||||
}
|
||||
// If it's a console bookmark add request
|
||||
if (isset($_REQUEST['console_bookmark_add'])) {
|
||||
if (isset($_REQUEST['label']) && isset($_REQUEST['db'])
|
||||
&& isset($_REQUEST['bookmark_query']) && isset($_REQUEST['shared'])
|
||||
if (isset($_POST['console_bookmark_add'])) {
|
||||
if (isset($_POST['label']) && isset($_POST['db'])
|
||||
&& isset($_POST['bookmark_query']) && isset($_POST['shared'])
|
||||
) {
|
||||
$cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']);
|
||||
$bookmarkFields = array(
|
||||
'bkm_database' => $_REQUEST['db'],
|
||||
'bkm_database' => $_POST['db'],
|
||||
'bkm_user' => $cfgBookmark['user'],
|
||||
'bkm_sql_query' => $_REQUEST['bookmark_query'],
|
||||
'bkm_label' => $_REQUEST['label']
|
||||
'bkm_sql_query' => $_POST['bookmark_query'],
|
||||
'bkm_label' => $_POST['label']
|
||||
);
|
||||
$isShared = ($_REQUEST['shared'] == 'true' ? true : false);
|
||||
$isShared = ($_POST['shared'] == 'true' ? true : false);
|
||||
$bookmark = Bookmark::createBookmark(
|
||||
$GLOBALS['dbi'],
|
||||
$GLOBALS['cfg']['Server']['user'],
|
||||
@ -124,11 +124,11 @@ $ajax_reload = array();
|
||||
if (! empty($sql_query)) {
|
||||
|
||||
// apply values for parameters
|
||||
if (! empty($_REQUEST['parameterized'])
|
||||
&& ! empty($_REQUEST['parameters'])
|
||||
&& is_array($_REQUEST['parameters'])
|
||||
if (! empty($_POST['parameterized'])
|
||||
&& ! empty($_POST['parameters'])
|
||||
&& is_array($_POST['parameters'])
|
||||
) {
|
||||
$parameters = $_REQUEST['parameters'];
|
||||
$parameters = $_POST['parameters'];
|
||||
foreach ($parameters as $parameter => $replacement) {
|
||||
$quoted = preg_quote($parameter, '/');
|
||||
// making sure that :param does not apply values to :param1
|
||||
@ -153,7 +153,7 @@ if (! empty($sql_query)) {
|
||||
$_SESSION['sql_from_query_box'] = true;
|
||||
|
||||
// If there is a request to ROLLBACK when finished.
|
||||
if (isset($_REQUEST['rollback_query'])) {
|
||||
if (isset($_POST['rollback_query'])) {
|
||||
Import::handleRollbackRequest($import_text);
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ if (! empty($sql_query)) {
|
||||
$import_type = 'queryfile';
|
||||
$format = 'sql';
|
||||
unset($sql_file);
|
||||
} elseif (! empty($_REQUEST['id_bookmark'])) {
|
||||
} elseif (! empty($_POST['id_bookmark'])) {
|
||||
// run bookmark
|
||||
$import_type = 'query';
|
||||
$format = 'sql';
|
||||
@ -305,7 +305,7 @@ if (! empty($cfg['MemoryLimit'])) {
|
||||
}
|
||||
|
||||
$timestamp = time();
|
||||
if (isset($_REQUEST['allow_interrupt'])) {
|
||||
if (isset($_POST['allow_interrupt'])) {
|
||||
$maximum_time = ini_get('max_execution_time');
|
||||
} else {
|
||||
$maximum_time = 0;
|
||||
@ -331,9 +331,9 @@ $result = false;
|
||||
$msg = 'Sorry an unexpected error happened!';
|
||||
|
||||
// Bookmark Support: get a query back from bookmark if required
|
||||
if (! empty($_REQUEST['id_bookmark'])) {
|
||||
$id_bookmark = (int)$_REQUEST['id_bookmark'];
|
||||
switch ($_REQUEST['action_bookmark']) {
|
||||
if (! empty($_POST['id_bookmark'])) {
|
||||
$id_bookmark = (int)$_POST['id_bookmark'];
|
||||
switch ($_POST['action_bookmark']) {
|
||||
case 0: // bookmarked query that have to be run
|
||||
$bookmark = Bookmark::get(
|
||||
$GLOBALS['dbi'],
|
||||
@ -341,12 +341,12 @@ if (! empty($_REQUEST['id_bookmark'])) {
|
||||
$db,
|
||||
$id_bookmark,
|
||||
'id',
|
||||
isset($_REQUEST['action_bookmark_all'])
|
||||
isset($_POST['action_bookmark_all'])
|
||||
);
|
||||
|
||||
if (! empty($_REQUEST['bookmark_variable'])) {
|
||||
if (! empty($_POST['bookmark_variable'])) {
|
||||
$import_text = $bookmark->applyVariables(
|
||||
$_REQUEST['bookmark_variable']
|
||||
$_POST['bookmark_variable']
|
||||
);
|
||||
} else {
|
||||
$import_text = $bookmark->getQuery();
|
||||
@ -383,7 +383,7 @@ if (! empty($_REQUEST['id_bookmark'])) {
|
||||
$response->setRequestStatus($message->isSuccess());
|
||||
$response->addJSON('message', $message);
|
||||
$response->addJSON('sql_query', $import_text);
|
||||
$response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
|
||||
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
|
||||
exit;
|
||||
} else {
|
||||
$run_query = false;
|
||||
@ -404,7 +404,7 @@ if (! empty($_REQUEST['id_bookmark'])) {
|
||||
);
|
||||
$response->setRequestStatus($message->isSuccess());
|
||||
$response->addJSON('message', $message);
|
||||
$response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
|
||||
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
|
||||
$response->addJSON('id_bookmark', $id_bookmark);
|
||||
exit;
|
||||
} else {
|
||||
@ -576,11 +576,11 @@ if ($reset_charset) {
|
||||
}
|
||||
|
||||
// Show correct message
|
||||
if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) {
|
||||
if (! empty($id_bookmark) && $_POST['action_bookmark'] == 2) {
|
||||
$message = PhpMyAdmin\Message::success(__('The bookmark has been deleted.'));
|
||||
$display_query = $import_text;
|
||||
$error = false; // unset error marker, it was used just to skip processing
|
||||
} elseif (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 1) {
|
||||
} elseif (! empty($id_bookmark) && $_POST['action_bookmark'] == 1) {
|
||||
$message = PhpMyAdmin\Message::notice(__('Showing bookmark'));
|
||||
} elseif ($bookmark_created) {
|
||||
$special_message = '[br]' . sprintf(
|
||||
@ -779,6 +779,6 @@ if ($go_sql) {
|
||||
}
|
||||
|
||||
// If there is request for ROLLBACK in the end.
|
||||
if (isset($_REQUEST['rollback_query'])) {
|
||||
if (isset($_POST['rollback_query'])) {
|
||||
$GLOBALS['dbi']->query('ROLLBACK');
|
||||
}
|
||||
|
||||
@ -621,7 +621,7 @@ if ($server > 0) {
|
||||
);
|
||||
}
|
||||
$msg = Message::notice($msg_text);
|
||||
$msg->addParamHtml('<a href="./chk_rel.php' . $common_url_query . '">');
|
||||
$msg->addParamHtml('<a href="./chk_rel.php" data-post="' . $common_url_query . '">');
|
||||
$msg->addParamHtml('</a>');
|
||||
/* Show error if user has configured something, notice elsewhere */
|
||||
if (!empty($cfg['Servers'][$server]['pmadb'])) {
|
||||
|
||||
@ -65,10 +65,10 @@ AJAX.registerOnload('db_central_columns.js', function () {
|
||||
return false;
|
||||
}
|
||||
var argsep = PMA_commonParams.get('arg_separator');
|
||||
var editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + PMA_commonParams.get('db');
|
||||
var editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(PMA_commonParams.get('db'));
|
||||
PMA_ajaxShowMessage();
|
||||
AJAX.source = $(this);
|
||||
$.get('db_central_columns.php', editColumnData, AJAX.responseHandler);
|
||||
$.post('db_central_columns.php', editColumnData, AJAX.responseHandler);
|
||||
});
|
||||
$('#multi_edit_central_columns').submit(function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -84,10 +84,9 @@ AJAX.registerOnload('db_tracking.js', function () {
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);
|
||||
AJAX.source = $anchor;
|
||||
var params = {
|
||||
'ajax_page_request': true,
|
||||
'ajax_request': true
|
||||
};
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
});
|
||||
});
|
||||
|
||||
@ -19,7 +19,7 @@ var ErrorReport = {
|
||||
exception.name = ErrorReport._extractExceptionName(exception);
|
||||
}
|
||||
ErrorReport._last_exception = exception;
|
||||
$.get('error_report.php', {
|
||||
$.post('error_report.php', {
|
||||
ajax_request: true,
|
||||
server: PMA_commonParams.get('server'),
|
||||
get_settings: true,
|
||||
@ -107,7 +107,7 @@ var ErrorReport = {
|
||||
}
|
||||
});
|
||||
}
|
||||
}); // end $.get()
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Shows the small notification that asks for user permission
|
||||
|
||||
@ -3797,7 +3797,7 @@ function indexEditorDialog (url, title, callback_success, callback_failure) {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
$.get('tbl_indexes.php', url, function (data) {
|
||||
$.post('tbl_indexes.php', url, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === false) {
|
||||
// in the case of an error, show the error message returned.
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
@ -4543,8 +4543,9 @@ function PMA_createViewDialog ($this) {
|
||||
var $msg = PMA_ajaxShowMessage();
|
||||
var syntaxHighlighter = null;
|
||||
var sep = PMA_commonParams.get('arg_separator');
|
||||
params = $this.getPostData();
|
||||
$.get($this.attr('href') + sep + 'ajax_request=1' + sep + 'ajax_dialog=1' + sep + params, function (data) {
|
||||
var params = getJSConfirmCommonParam(this, $this.getPostData());
|
||||
params += sep + 'ajax_dialog=1';
|
||||
$.post($this.attr('href'), params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
var buttonOptions = {};
|
||||
|
||||
@ -660,10 +660,7 @@ AJAX.registerOnload('indexes.js', function () {
|
||||
title = PMA_messages.strAddIndex;
|
||||
} else {
|
||||
// Edit index
|
||||
url = $(this).find('a').attr('href');
|
||||
if (url.substring(0, 16) === 'tbl_indexes.php?') {
|
||||
url = url.substring(16, url.length);
|
||||
}
|
||||
url = $(this).find('a').getPostData();
|
||||
title = PMA_messages.strEditIndex;
|
||||
}
|
||||
url += PMA_commonParams.get('arg_separator') + 'ajax_request=true';
|
||||
|
||||
@ -519,12 +519,13 @@ $(function () {
|
||||
/** Hide navigation tree item */
|
||||
$(document).on('click', 'a.hideNavItem.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
server: PMA_commonParams.get('server'),
|
||||
},
|
||||
url: $(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=true',
|
||||
data: params,
|
||||
url: $(this).attr('href'),
|
||||
success: function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
PMA_reloadNavigation();
|
||||
@ -539,7 +540,10 @@ $(function () {
|
||||
$(document).on('click', 'a.showUnhide.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
var $msg = PMA_ajaxShowMessage();
|
||||
$.get($(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=1', function (data) {
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
var buttonOptions = {};
|
||||
@ -570,12 +574,13 @@ $(function () {
|
||||
event.preventDefault();
|
||||
var $tr = $(this).parents('tr');
|
||||
var $msg = PMA_ajaxShowMessage();
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {
|
||||
server: PMA_commonParams.get('server'),
|
||||
},
|
||||
url: $(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=true',
|
||||
data: params,
|
||||
url: $(this).attr('href'),
|
||||
success: function (data) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
|
||||
@ -60,13 +60,14 @@ AJAX.registerOnload('server_databases.js', function () {
|
||||
$(this).PMA_confirm(
|
||||
question,
|
||||
$form.prop('action') + '?' + $(this).serialize() +
|
||||
argsep + 'drop_selected_dbs=1' + argsep + 'is_js_confirmed=1' + argsep + 'ajax_request=true',
|
||||
argsep + 'drop_selected_dbs=1',
|
||||
function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest, false);
|
||||
|
||||
var params = getJSConfirmCommonParam(this);
|
||||
var parts = url.split('?');
|
||||
var params = getJSConfirmCommonParam(this, parts[1]);
|
||||
|
||||
$.post(url, params, function (data) {
|
||||
$.post(parts[0], params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
|
||||
@ -686,7 +686,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
$.extend(vars, getvars);
|
||||
}
|
||||
|
||||
$.get('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars,
|
||||
$.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars,
|
||||
function (data) {
|
||||
var logVars;
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@ -1591,9 +1591,10 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
buttons: dlgBtns
|
||||
});
|
||||
|
||||
|
||||
logRequest = $.get('server_status_monitor.php' + PMA_commonParams.get('common_query'),
|
||||
{ ajax_request: true,
|
||||
logRequest = $.post(
|
||||
'server_status_monitor.php' + PMA_commonParams.get('common_query'),
|
||||
{
|
||||
ajax_request: true,
|
||||
log_data: 1,
|
||||
type: opts.src,
|
||||
time_start: Math.round(opts.start / 1000),
|
||||
|
||||
@ -47,10 +47,12 @@ var processList = {
|
||||
*/
|
||||
killProcessHandler: function (event) {
|
||||
event.preventDefault();
|
||||
var url = $(this).attr('href');
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=1' + argSep + 'server=' + PMA_commonParams.get('server');
|
||||
// Get row element of the process to be killed.
|
||||
var $tr = $(this).closest('tr');
|
||||
$.getJSON(url, function (data) {
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
// Check if process was killed or not.
|
||||
if (data.hasOwnProperty('success') && data.success) {
|
||||
// remove the row of killed process.
|
||||
@ -66,7 +68,7 @@ var processList = {
|
||||
// Show process error message
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
},
|
||||
|
||||
/**
|
||||
@ -86,7 +88,7 @@ var processList = {
|
||||
if (processList.autoRefresh) {
|
||||
var interval = parseInt(processList.refreshInterval, 10) * 1000;
|
||||
var urlParams = processList.getUrlParams();
|
||||
processList.refreshRequest = $.get(processList.refreshUrl,
|
||||
processList.refreshRequest = $.post(processList.refreshUrl,
|
||||
urlParams,
|
||||
function (data) {
|
||||
if (data.hasOwnProperty('success') && data.success) {
|
||||
|
||||
@ -792,7 +792,10 @@ function browseForeignDialog ($this_a) {
|
||||
var tableId = '#browse_foreign_table';
|
||||
var filterId = '#input_foreign_filter';
|
||||
var $dialog = null;
|
||||
$.get($this_a.attr('href'), { 'ajax_request': true }, function (data) {
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = $this_a.getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
$.post($this_a.attr('href'), params, function (data) {
|
||||
// Creates browse foreign value dialog
|
||||
$dialog = $('<div>').append(data.message).dialog({
|
||||
title: PMA_messages.strBrowseForeignValues,
|
||||
|
||||
@ -72,7 +72,7 @@ function getDropdownValues ($dropdown) {
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
var $form = $dropdown.parents('form');
|
||||
var argsep = PMA_commonParams.get('arg_separator');
|
||||
var url = 'tbl_relation.php?getDropdownValues=true' + argsep + 'ajax_request=true' +
|
||||
var params = 'getDropdownValues=true' + argsep + 'ajax_request=true' +
|
||||
argsep + 'db=' + $form.find('input[name="db"]').val() +
|
||||
argsep + 'table=' + $form.find('input[name="table"]').val() +
|
||||
argsep + 'foreign=' + (foreign !== '') +
|
||||
@ -82,11 +82,13 @@ function getDropdownValues ($dropdown) {
|
||||
);
|
||||
var $server = $form.find('input[name="server"]');
|
||||
if ($server.length > 0) {
|
||||
url += argsep + 'server=' + $form.find('input[name="server"]').val();
|
||||
params += argsep + 'server=' + $form.find('input[name="server"]').val();
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
datatype: 'json',
|
||||
type: 'POST',
|
||||
url: 'tbl_relation.php',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
if (typeof data !== 'undefined' && data.success) {
|
||||
|
||||
@ -80,10 +80,9 @@ AJAX.registerOnload('tbl_tracking.js', function () {
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage();
|
||||
AJAX.source = $anchor;
|
||||
var params = {
|
||||
'ajax_page_request': true,
|
||||
'ajax_request': true
|
||||
};
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
});
|
||||
});
|
||||
@ -98,10 +97,9 @@ AJAX.registerOnload('tbl_tracking.js', function () {
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage();
|
||||
AJAX.source = $anchor;
|
||||
var params = {
|
||||
'ajax_page_request': true,
|
||||
'ajax_request': true
|
||||
};
|
||||
var argSep = PMA_commonParams.get('arg_separator');
|
||||
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
});
|
||||
});
|
||||
|
||||
@ -182,12 +182,12 @@ class BrowseForeigners
|
||||
. '<input type="hidden" name="fieldkey" value="'
|
||||
. (isset($fieldkey) ? htmlspecialchars($fieldkey) : '') . '" />';
|
||||
|
||||
if (isset($_REQUEST['rownumber'])) {
|
||||
if (isset($_POST['rownumber'])) {
|
||||
$output .= '<input type="hidden" name="rownumber" value="'
|
||||
. htmlspecialchars($_REQUEST['rownumber']) . '" />';
|
||||
. htmlspecialchars($_POST['rownumber']) . '" />';
|
||||
}
|
||||
$filter_value = (isset($_REQUEST['foreign_filter'])
|
||||
? htmlspecialchars($_REQUEST['foreign_filter'])
|
||||
$filter_value = (isset($_POST['foreign_filter'])
|
||||
? htmlspecialchars($_POST['foreign_filter'])
|
||||
: '');
|
||||
$output .= '<span class="formelement">'
|
||||
. '<label for="input_foreign_filter">' . __('Search:') . '</label>'
|
||||
@ -302,7 +302,7 @@ class BrowseForeigners
|
||||
private function getHtmlForGotoPage($foreignData)
|
||||
{
|
||||
$gotopage = '';
|
||||
isset($_REQUEST['pos']) ? $pos = $_REQUEST['pos'] : $pos = 0;
|
||||
isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0;
|
||||
if (!is_array($foreignData['disp_row'])) {
|
||||
return $gotopage;
|
||||
}
|
||||
@ -340,7 +340,7 @@ class BrowseForeigners
|
||||
if (isset($foreignShowAll) && $foreignShowAll == __('Show all')) {
|
||||
return null;
|
||||
}
|
||||
isset($_REQUEST['pos']) ? $pos = $_REQUEST['pos'] : $pos = 0;
|
||||
isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0;
|
||||
return 'LIMIT ' . $pos . ', ' . $this->maxRows . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ class CentralColumns
|
||||
if (empty($cfgCentralColumns)) {
|
||||
return $this->configErrorMessage();
|
||||
}
|
||||
$db = $_REQUEST['db'];
|
||||
$db = $_POST['db'];
|
||||
$pmadb = $cfgCentralColumns['db'];
|
||||
$central_list_table = $cfgCentralColumns['table'];
|
||||
$this->dbi->selectDb($db);
|
||||
@ -333,7 +333,7 @@ class CentralColumns
|
||||
}
|
||||
} else {
|
||||
if ($table === null) {
|
||||
$table = $_REQUEST['table'];
|
||||
$table = $_POST['table'];
|
||||
}
|
||||
foreach ($field_select as $column) {
|
||||
$cols .= "'" . $this->dbi->escapeString($column) . "',";
|
||||
@ -406,7 +406,7 @@ class CentralColumns
|
||||
if (empty($cfgCentralColumns)) {
|
||||
return $this->configErrorMessage();
|
||||
}
|
||||
$db = $_REQUEST['db'];
|
||||
$db = $_POST['db'];
|
||||
$pmadb = $cfgCentralColumns['db'];
|
||||
$central_list_table = $cfgCentralColumns['table'];
|
||||
$this->dbi->selectDb($db);
|
||||
|
||||
@ -55,15 +55,15 @@ class ServerBinlogController extends Controller
|
||||
include_once 'libraries/server_common.inc.php';
|
||||
|
||||
$url_params = array();
|
||||
if (! isset($_REQUEST['log'])
|
||||
|| ! array_key_exists($_REQUEST['log'], $this->binary_logs)
|
||||
if (! isset($_POST['log'])
|
||||
|| ! array_key_exists($_POST['log'], $this->binary_logs)
|
||||
) {
|
||||
$_REQUEST['log'] = '';
|
||||
$_POST['log'] = '';
|
||||
} else {
|
||||
$url_params['log'] = $_REQUEST['log'];
|
||||
$url_params['log'] = $_POST['log'];
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['dontlimitchars'])) {
|
||||
if (!empty($_POST['dontlimitchars'])) {
|
||||
$url_params['dontlimitchars'] = 1;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ class ServerBinlogController extends Controller
|
||||
array(
|
||||
'url_params' => $url_params,
|
||||
'binary_logs' => $this->binary_logs,
|
||||
'log' => $_REQUEST['log'],
|
||||
'log' => $_POST['log'],
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -106,16 +106,16 @@ class ServerBinlogController extends Controller
|
||||
/**
|
||||
* Need to find the real end of rows?
|
||||
*/
|
||||
if (! isset($_REQUEST['pos'])) {
|
||||
if (! isset($_POST['pos'])) {
|
||||
$pos = 0;
|
||||
} else {
|
||||
/* We need this to be a integer */
|
||||
$pos = (int) $_REQUEST['pos'];
|
||||
$pos = (int) $_POST['pos'];
|
||||
}
|
||||
|
||||
$sql_query = 'SHOW BINLOG EVENTS';
|
||||
if (! empty($_REQUEST['log'])) {
|
||||
$sql_query .= ' IN \'' . $_REQUEST['log'] . '\'';
|
||||
if (! empty($_POST['log'])) {
|
||||
$sql_query .= ' IN \'' . $_POST['log'] . '\'';
|
||||
}
|
||||
$sql_query .= ' LIMIT ' . $pos . ', ' . intval($GLOBALS['cfg']['MaxRows']);
|
||||
|
||||
@ -134,7 +134,7 @@ class ServerBinlogController extends Controller
|
||||
$num_rows = 0;
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['dontlimitchars'])) {
|
||||
if (empty($_POST['dontlimitchars'])) {
|
||||
$dontlimitchars = false;
|
||||
} else {
|
||||
$dontlimitchars = true;
|
||||
@ -192,8 +192,8 @@ class ServerBinlogController extends Controller
|
||||
$this_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxRows'];
|
||||
}
|
||||
|
||||
$html .= '<a href="server_binlog.php'
|
||||
. Url::getCommon($this_url_params) . '"';
|
||||
$html .= '<a href="server_binlog.php" data-post="'
|
||||
. Url::getCommon($this_url_params, '') . '"';
|
||||
if (Util::showIcons('TableNavigationLinksMode')) {
|
||||
$html .= ' title="' . _pgettext('Previous page', 'Previous') . '">';
|
||||
} else {
|
||||
@ -215,7 +215,7 @@ class ServerBinlogController extends Controller
|
||||
$tempTitle = __('Show Full Queries');
|
||||
$tempImgMode = 'full';
|
||||
}
|
||||
$html .= '<a href="server_binlog.php' . Url::getCommon($this_url_params)
|
||||
$html .= '<a href="server_binlog.php" data-post="' . Url::getCommon($this_url_params, '')
|
||||
. '" title="' . $tempTitle . '">'
|
||||
. '<img src="' . $GLOBALS['pmaThemeImage'] . 's_' . $tempImgMode
|
||||
. 'text.png" alt="' . $tempTitle . '" /></a>';
|
||||
@ -225,8 +225,8 @@ class ServerBinlogController extends Controller
|
||||
if ($num_rows >= $GLOBALS['cfg']['MaxRows']) {
|
||||
$this_url_params = $url_params;
|
||||
$this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows'];
|
||||
$html .= ' - <a href="server_binlog.php'
|
||||
. Url::getCommon($this_url_params)
|
||||
$html .= ' - <a href="server_binlog.php" data-post="'
|
||||
. Url::getCommon($this_url_params, '')
|
||||
. '"';
|
||||
if (Util::showIcons('TableNavigationLinksMode')) {
|
||||
$html .= ' title="' . _pgettext('Next page', 'Next') . '">';
|
||||
|
||||
@ -62,7 +62,7 @@ class ServerDatabasesController extends Controller
|
||||
|
||||
$response = Response::getInstance();
|
||||
|
||||
if (isset($_REQUEST['drop_selected_dbs'])
|
||||
if (isset($_POST['drop_selected_dbs'])
|
||||
&& $response->isAjax()
|
||||
&& ($GLOBALS['dbi']->isSuperuser() || $GLOBALS['cfg']['AllowUserDropDatabase'])
|
||||
) {
|
||||
@ -184,7 +184,7 @@ class ServerDatabasesController extends Controller
|
||||
*/
|
||||
public function dropDatabasesAction()
|
||||
{
|
||||
if (! isset($_REQUEST['selected_dbs'])) {
|
||||
if (! isset($_POST['selected_dbs'])) {
|
||||
$message = Message::error(__('No databases selected.'));
|
||||
} else {
|
||||
$action = 'server_databases.php';
|
||||
|
||||
@ -48,16 +48,16 @@ class ServerVariablesController extends Controller
|
||||
{
|
||||
$response = Response::getInstance();
|
||||
if ($response->isAjax()
|
||||
&& isset($_REQUEST['type'])
|
||||
&& $_REQUEST['type'] === 'getval'
|
||||
&& isset($_GET['type'])
|
||||
&& $_GET['type'] === 'getval'
|
||||
) {
|
||||
$this->getValueAction();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($response->isAjax()
|
||||
&& isset($_REQUEST['type'])
|
||||
&& $_REQUEST['type'] === 'setval'
|
||||
&& isset($_POST['type'])
|
||||
&& $_POST['type'] === 'setval'
|
||||
) {
|
||||
$this->setValueAction();
|
||||
return;
|
||||
@ -140,12 +140,12 @@ class ServerVariablesController extends Controller
|
||||
// when server is running in ANSI_QUOTES sql_mode
|
||||
$varValue = $this->dbi->fetchSingleRow(
|
||||
'SHOW GLOBAL VARIABLES WHERE Variable_name=\''
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['varName']) . '\';',
|
||||
. $GLOBALS['dbi']->escapeString($_GET['varName']) . '\';',
|
||||
'NUM'
|
||||
);
|
||||
|
||||
if (isset($this->variable_doc_links[$_REQUEST['varName']][3])
|
||||
&& $this->variable_doc_links[$_REQUEST['varName']][3] == 'byte'
|
||||
if (isset($this->variable_doc_links[$_GET['varName']][3])
|
||||
&& $this->variable_doc_links[$_GET['varName']][3] == 'byte'
|
||||
) {
|
||||
$this->response->addJSON(
|
||||
'message',
|
||||
@ -168,11 +168,11 @@ class ServerVariablesController extends Controller
|
||||
*/
|
||||
public function setValueAction()
|
||||
{
|
||||
$value = $_REQUEST['varValue'];
|
||||
$value = $_POST['varValue'];
|
||||
$matches = array();
|
||||
|
||||
if (isset($this->variable_doc_links[$_REQUEST['varName']][3])
|
||||
&& $this->variable_doc_links[$_REQUEST['varName']][3] == 'byte'
|
||||
if (isset($this->variable_doc_links[$_POST['varName']][3])
|
||||
&& $this->variable_doc_links[$_POST['varName']][3] == 'byte'
|
||||
&& preg_match(
|
||||
'/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i',
|
||||
$value,
|
||||
@ -199,19 +199,19 @@ class ServerVariablesController extends Controller
|
||||
$value="'" . $value . "'";
|
||||
}
|
||||
|
||||
if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])
|
||||
if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName'])
|
||||
&& $this->dbi->query(
|
||||
'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value
|
||||
'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value
|
||||
)
|
||||
) {
|
||||
// Some values are rounded down etc.
|
||||
$varValue = $this->dbi->fetchSingleRow(
|
||||
'SHOW GLOBAL VARIABLES WHERE Variable_name="'
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['varName'])
|
||||
. $GLOBALS['dbi']->escapeString($_POST['varName'])
|
||||
. '";', 'NUM'
|
||||
);
|
||||
list($formattedValue, $isHtmlFormatted) = $this->_formatVariable(
|
||||
$_REQUEST['varName'], $varValue[1]
|
||||
$_POST['varName'], $varValue[1]
|
||||
);
|
||||
|
||||
if ($isHtmlFormatted == false) {
|
||||
|
||||
@ -50,7 +50,7 @@ class TableIndexesController extends TableController
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
if (isset($_REQUEST['do_save_data'])) {
|
||||
if (isset($_POST['do_save_data'])) {
|
||||
$this->doSaveDataAction();
|
||||
return;
|
||||
} // end builds the new index
|
||||
@ -67,24 +67,24 @@ class TableIndexesController extends TableController
|
||||
{
|
||||
$GLOBALS['dbi']->selectDb($GLOBALS['db']);
|
||||
$add_fields = 0;
|
||||
if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
|
||||
if (isset($_POST['index']) && is_array($_POST['index'])) {
|
||||
// coming already from form
|
||||
if (isset($_REQUEST['index']['columns']['names'])) {
|
||||
$add_fields = count($_REQUEST['index']['columns']['names'])
|
||||
if (isset($_POST['index']['columns']['names'])) {
|
||||
$add_fields = count($_POST['index']['columns']['names'])
|
||||
- $this->index->getColumnCount();
|
||||
}
|
||||
if (isset($_REQUEST['add_fields'])) {
|
||||
$add_fields += $_REQUEST['added_fields'];
|
||||
if (isset($_POST['add_fields'])) {
|
||||
$add_fields += $_POST['added_fields'];
|
||||
}
|
||||
} elseif (isset($_REQUEST['create_index'])) {
|
||||
$add_fields = $_REQUEST['added_fields'];
|
||||
} elseif (isset($_POST['create_index'])) {
|
||||
$add_fields = $_POST['added_fields'];
|
||||
} // end preparing form values
|
||||
|
||||
// Get fields and stores their name/type
|
||||
if (isset($_REQUEST['create_edit_table'])) {
|
||||
$fields = json_decode($_REQUEST['columns'], true);
|
||||
if (isset($_POST['create_edit_table'])) {
|
||||
$fields = json_decode($_POST['columns'], true);
|
||||
$index_params = array(
|
||||
'Non_unique' => ($_REQUEST['index']['Index_choice'] == 'UNIQUE')
|
||||
'Non_unique' => ($_POST['index']['Index_choice'] == 'UNIQUE')
|
||||
? '0' : '1',
|
||||
);
|
||||
$this->index->set($index_params);
|
||||
@ -99,12 +99,12 @@ class TableIndexesController extends TableController
|
||||
'table' => $this->table,
|
||||
);
|
||||
|
||||
if (isset($_REQUEST['create_index'])) {
|
||||
if (isset($_POST['create_index'])) {
|
||||
$form_params['create_index'] = 1;
|
||||
} elseif (isset($_REQUEST['old_index'])) {
|
||||
$form_params['old_index'] = $_REQUEST['old_index'];
|
||||
} elseif (isset($_REQUEST['index'])) {
|
||||
$form_params['old_index'] = $_REQUEST['index'];
|
||||
} elseif (isset($_POST['old_index'])) {
|
||||
$form_params['old_index'] = $_POST['old_index'];
|
||||
} elseif (isset($_POST['index'])) {
|
||||
$form_params['old_index'] = $_POST['index'];
|
||||
}
|
||||
|
||||
$this->response->getHeader()->getScripts()->addFile('indexes.js');
|
||||
@ -116,7 +116,7 @@ class TableIndexesController extends TableController
|
||||
'index' => $this->index,
|
||||
'form_params' => $form_params,
|
||||
'add_fields' => $add_fields,
|
||||
'create_edit_table' => isset($_REQUEST['create_edit_table'])
|
||||
'create_edit_table' => isset($_POST['create_edit_table'])
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -137,7 +137,7 @@ class TableIndexesController extends TableController
|
||||
->getSqlQueryForIndexCreateOrEdit($this->index, $error);
|
||||
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
|
||||
$this->response->addJSON(
|
||||
'sql_data',
|
||||
|
||||
@ -100,11 +100,11 @@ class TableRelationController extends TableController
|
||||
{
|
||||
// Send table of column names to populate corresponding dropdowns depending
|
||||
// on the current selection
|
||||
if (isset($_REQUEST['getDropdownValues'])
|
||||
&& $_REQUEST['getDropdownValues'] === 'true'
|
||||
if (isset($_POST['getDropdownValues'])
|
||||
&& $_POST['getDropdownValues'] === 'true'
|
||||
) {
|
||||
// if both db and table are selected
|
||||
if (isset($_REQUEST['foreignTable'])) {
|
||||
if (isset($_POST['foreignTable'])) {
|
||||
$this->getDropdownValueForTableAction();
|
||||
} else { // if only the db is selected
|
||||
$this->getDropdownValueForDbAction();
|
||||
@ -241,8 +241,8 @@ class TableRelationController extends TableController
|
||||
*/
|
||||
public function updateForForeignKeysAction()
|
||||
{
|
||||
$multi_edit_columns_name = isset($_REQUEST['foreign_key_fields_name'])
|
||||
? $_REQUEST['foreign_key_fields_name']
|
||||
$multi_edit_columns_name = isset($_POST['foreign_key_fields_name'])
|
||||
? $_POST['foreign_key_fields_name']
|
||||
: null;
|
||||
|
||||
// (for now, one index name only; we keep the definitions if the
|
||||
@ -260,7 +260,7 @@ class TableRelationController extends TableController
|
||||
$this->response->addHTML($html);
|
||||
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
Core::previewSQL($preview_sql_data);
|
||||
}
|
||||
|
||||
@ -282,8 +282,8 @@ class TableRelationController extends TableController
|
||||
*/
|
||||
public function updateForInternalRelationAction()
|
||||
{
|
||||
$multi_edit_columns_name = isset($_REQUEST['fields_name'])
|
||||
? $_REQUEST['fields_name']
|
||||
$multi_edit_columns_name = isset($_POST['fields_name'])
|
||||
? $_POST['fields_name']
|
||||
: null;
|
||||
|
||||
if ($this->upd_query->updateInternalRelations(
|
||||
@ -312,8 +312,8 @@ class TableRelationController extends TableController
|
||||
*/
|
||||
public function getDropdownValueForTableAction()
|
||||
{
|
||||
$foreignTable = $_REQUEST['foreignTable'];
|
||||
$table_obj = $this->dbi->getTable($_REQUEST['foreignDb'], $foreignTable);
|
||||
$foreignTable = $_POST['foreignTable'];
|
||||
$table_obj = $this->dbi->getTable($_POST['foreignDb'], $foreignTable);
|
||||
// Since views do not have keys defined on them provide the full list of
|
||||
// columns
|
||||
if ($table_obj->isView()) {
|
||||
@ -331,7 +331,7 @@ class TableRelationController extends TableController
|
||||
$this->response->addJSON('columns', $columns);
|
||||
|
||||
// @todo should be: $server->db($db)->table($table)->primary()
|
||||
$primary = Index::getPrimary($foreignTable, $_REQUEST['foreignDb']);
|
||||
$primary = Index::getPrimary($foreignTable, $_POST['foreignDb']);
|
||||
if (false === $primary) {
|
||||
return;
|
||||
}
|
||||
@ -348,11 +348,11 @@ class TableRelationController extends TableController
|
||||
public function getDropdownValueForDbAction()
|
||||
{
|
||||
$tables = array();
|
||||
$foreign = isset($_REQUEST['foreign']) && $_REQUEST['foreign'] === 'true';
|
||||
$foreign = isset($_POST['foreign']) && $_POST['foreign'] === 'true';
|
||||
|
||||
if ($foreign) {
|
||||
$query = 'SHOW TABLE STATUS FROM '
|
||||
. Util::backquote($_REQUEST['foreignDb']);
|
||||
. Util::backquote($_POST['foreignDb']);
|
||||
$tables_rs = $this->dbi->query(
|
||||
$query,
|
||||
DatabaseInterface::CONNECT_USER,
|
||||
@ -368,7 +368,7 @@ class TableRelationController extends TableController
|
||||
}
|
||||
} else {
|
||||
$query = 'SHOW TABLES FROM '
|
||||
. Util::backquote($_REQUEST['foreignDb']);
|
||||
. Util::backquote($_POST['foreignDb']);
|
||||
$tables_rs = $this->dbi->query(
|
||||
$query,
|
||||
DatabaseInterface::CONNECT_USER,
|
||||
|
||||
@ -212,7 +212,7 @@ class TableSearchController extends TableController
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($_REQUEST['range_search'])) {
|
||||
if (isset($_POST['range_search'])) {
|
||||
$this->rangeSearchAction();
|
||||
|
||||
return;
|
||||
@ -253,8 +253,8 @@ class TableSearchController extends TableController
|
||||
*
|
||||
* @var boolean Object containing parameters for the POST request
|
||||
*/
|
||||
if (isset($_REQUEST['get_data_row'])
|
||||
&& $_REQUEST['get_data_row'] == true
|
||||
if (isset($_POST['get_data_row'])
|
||||
&& $_POST['get_data_row'] == true
|
||||
) {
|
||||
$this->getDataRowAction();
|
||||
|
||||
@ -266,8 +266,8 @@ class TableSearchController extends TableController
|
||||
*
|
||||
* @var boolean Object containing parameters for the POST request
|
||||
*/
|
||||
if (isset($_REQUEST['change_tbl_info'])
|
||||
&& $_REQUEST['change_tbl_info'] == true
|
||||
if (isset($_POST['change_tbl_info'])
|
||||
&& $_POST['change_tbl_info'] == true
|
||||
) {
|
||||
$this->changeTableInfoAction();
|
||||
|
||||
@ -390,7 +390,7 @@ class TableSearchController extends TableController
|
||||
*/
|
||||
public function changeTableInfoAction()
|
||||
{
|
||||
$field = $_REQUEST['field'];
|
||||
$field = $_POST['field'];
|
||||
if ($field == 'pma_null') {
|
||||
$this->response->addJSON('field_type', '');
|
||||
$this->response->addJSON('field_collation', '');
|
||||
@ -400,8 +400,8 @@ class TableSearchController extends TableController
|
||||
}
|
||||
$key = array_search($field, $this->_columnNames);
|
||||
$search_index
|
||||
= ((isset($_REQUEST['it']) && is_numeric($_REQUEST['it']))
|
||||
? intval($_REQUEST['it']) : 0);
|
||||
= ((isset($_POST['it']) && is_numeric($_POST['it']))
|
||||
? intval($_POST['it']) : 0);
|
||||
|
||||
$properties = $this->getColumnProperties($search_index, $key);
|
||||
$this->response->addJSON(
|
||||
@ -420,8 +420,8 @@ class TableSearchController extends TableController
|
||||
public function getDataRowAction()
|
||||
{
|
||||
$extra_data = array();
|
||||
$row_info_query = 'SELECT * FROM `' . $_REQUEST['db'] . '`.`'
|
||||
. $_REQUEST['table'] . '` WHERE ' . $_REQUEST['where_clause'];
|
||||
$row_info_query = 'SELECT * FROM `' . $_POST['db'] . '`.`'
|
||||
. $_POST['table'] . '` WHERE ' . $_POST['where_clause'];
|
||||
$result = $this->dbi->query(
|
||||
$row_info_query . ";",
|
||||
DatabaseInterface::CONNECT_USER,
|
||||
@ -542,7 +542,7 @@ class TableSearchController extends TableController
|
||||
*/
|
||||
public function rangeSearchAction()
|
||||
{
|
||||
$min_max = $this->getColumnMinMax($_REQUEST['column']);
|
||||
$min_max = $this->getColumnMinMax($_POST['column']);
|
||||
$this->response->addJSON('column_data', $min_max);
|
||||
}
|
||||
|
||||
|
||||
@ -153,8 +153,8 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* Handle column moving
|
||||
*/
|
||||
if (isset($_REQUEST['move_columns'])
|
||||
&& is_array($_REQUEST['move_columns'])
|
||||
if (isset($_POST['move_columns'])
|
||||
&& is_array($_POST['move_columns'])
|
||||
&& $this->response->isAjax()
|
||||
) {
|
||||
$this->moveColumns();
|
||||
@ -164,9 +164,9 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* handle MySQL reserved words columns check
|
||||
*/
|
||||
if (isset($_REQUEST['reserved_word_check'])) {
|
||||
if (isset($_POST['reserved_word_check'])) {
|
||||
if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) {
|
||||
$columns_names = $_REQUEST['field_name'];
|
||||
$columns_names = $_POST['field_name'];
|
||||
$reserved_keywords_names = array();
|
||||
foreach ($columns_names as $column) {
|
||||
if (Context::isKeyword(trim($column), true)) {
|
||||
@ -197,7 +197,7 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* A click on Change has been made for one column
|
||||
*/
|
||||
if (isset($_REQUEST['change_column'])) {
|
||||
if (isset($_GET['change_column'])) {
|
||||
$this->displayHtmlForColumnChange(null, 'tbl_structure.php');
|
||||
return;
|
||||
}
|
||||
@ -205,8 +205,8 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* Adding or editing partitioning of the table
|
||||
*/
|
||||
if (isset($_REQUEST['edit_partitioning'])
|
||||
&& ! isset($_REQUEST['save_partitioning'])
|
||||
if (isset($_POST['edit_partitioning'])
|
||||
&& ! isset($_POST['save_partitioning'])
|
||||
) {
|
||||
$this->displayHtmlForPartitionChange();
|
||||
return;
|
||||
@ -220,7 +220,7 @@ class TableStructureController extends TableController
|
||||
$submit_mult = $this->getMultipleFieldCommandType();
|
||||
|
||||
if (! empty($submit_mult)) {
|
||||
if (isset($_REQUEST['selected_fld'])) {
|
||||
if (isset($_POST['selected_fld'])) {
|
||||
if ($submit_mult == 'browse') {
|
||||
// browsing the table displaying only selected columns
|
||||
$this->displayTableBrowseForSelectedColumns(
|
||||
@ -230,13 +230,13 @@ class TableStructureController extends TableController
|
||||
// handle multiple field commands
|
||||
// handle confirmation of deleting multiple columns
|
||||
$action = 'tbl_structure.php';
|
||||
$GLOBALS['selected'] = $_REQUEST['selected_fld'];
|
||||
$GLOBALS['selected'] = $_POST['selected_fld'];
|
||||
list(
|
||||
$what_ret, $query_type_ret, $is_unset_submit_mult,
|
||||
$mult_btn_ret, $centralColsError
|
||||
)
|
||||
= $this->getDataForSubmitMult(
|
||||
$submit_mult, $_REQUEST['selected_fld'], $action
|
||||
$submit_mult, $_POST['selected_fld'], $action
|
||||
);
|
||||
//update the existing variables
|
||||
// todo: refactor mult_submits.inc.php such as
|
||||
@ -293,29 +293,29 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* Modifications have been submitted -> updates the table
|
||||
*/
|
||||
if (isset($_REQUEST['do_save_data'])) {
|
||||
if (isset($_POST['do_save_data'])) {
|
||||
$regenerate = $this->updateColumns();
|
||||
if ($regenerate) {
|
||||
// This happens when updating failed
|
||||
// @todo: do something appropriate
|
||||
} else {
|
||||
// continue to show the table's structure
|
||||
unset($_REQUEST['selected']);
|
||||
unset($_POST['selected']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifications to the partitioning have been submitted -> updates the table
|
||||
*/
|
||||
if (isset($_REQUEST['save_partitioning'])) {
|
||||
if (isset($_POST['save_partitioning'])) {
|
||||
$this->updatePartitioning();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adding indexes
|
||||
*/
|
||||
if (isset($_REQUEST['add_key'])
|
||||
|| isset($_REQUEST['partition_maintenance'])
|
||||
if (isset($_POST['add_key'])
|
||||
|| isset($_POST['partition_maintenance'])
|
||||
) {
|
||||
//todo: set some variables for sql.php include, to be eliminated
|
||||
//after refactoring sql.php
|
||||
@ -399,8 +399,8 @@ class TableStructureController extends TableController
|
||||
$changes = array();
|
||||
|
||||
// move columns from first to last
|
||||
for ($i = 0, $l = count($_REQUEST['move_columns']); $i < $l; $i++) {
|
||||
$column = $_REQUEST['move_columns'][$i];
|
||||
for ($i = 0, $l = count($_POST['move_columns']); $i < $l; $i++) {
|
||||
$column = $_POST['move_columns'][$i];
|
||||
// is this column already correctly placed?
|
||||
if ($column_names[$i] == $column) {
|
||||
continue;
|
||||
@ -554,7 +554,7 @@ class TableStructureController extends TableController
|
||||
protected function displayHtmlForPartitionChange()
|
||||
{
|
||||
$partitionDetails = null;
|
||||
if (! isset($_REQUEST['partition_by'])) {
|
||||
if (! isset($_POST['partition_by'])) {
|
||||
$partitionDetails = $this->_extractPartitionDetails();
|
||||
}
|
||||
|
||||
@ -778,18 +778,18 @@ class TableStructureController extends TableController
|
||||
);
|
||||
|
||||
foreach ($types as $type) {
|
||||
if (isset($_REQUEST['submit_mult_' . $type . '_x'])) {
|
||||
if (isset($_POST['submit_mult_' . $type . '_x'])) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['submit_mult'])) {
|
||||
return $_REQUEST['submit_mult'];
|
||||
} elseif (isset($_REQUEST['mult_btn'])
|
||||
&& $_REQUEST['mult_btn'] == __('Yes')
|
||||
if (isset($_POST['submit_mult'])) {
|
||||
return $_POST['submit_mult'];
|
||||
} elseif (isset($_POST['mult_btn'])
|
||||
&& $_POST['mult_btn'] == __('Yes')
|
||||
) {
|
||||
if (isset($_REQUEST['selected'])) {
|
||||
$_REQUEST['selected_fld'] = $_REQUEST['selected'];
|
||||
if (isset($_POST['selected'])) {
|
||||
$_POST['selected_fld'] = $_POST['selected'];
|
||||
}
|
||||
return 'row_delete';
|
||||
}
|
||||
@ -809,7 +809,7 @@ class TableStructureController extends TableController
|
||||
{
|
||||
$GLOBALS['active_page'] = 'sql.php';
|
||||
$fields = array();
|
||||
foreach ($_REQUEST['selected_fld'] as $sval) {
|
||||
foreach ($_POST['selected_fld'] as $sval) {
|
||||
$fields[] = Util::backquote($sval);
|
||||
}
|
||||
$sql_query = sprintf(
|
||||
@ -867,7 +867,7 @@ class TableStructureController extends TableController
|
||||
)
|
||||
);
|
||||
$regenerate = false;
|
||||
$field_cnt = count($_REQUEST['field_name']);
|
||||
$field_cnt = count($_POST['field_name']);
|
||||
$changes = array();
|
||||
$adjust_privileges = array();
|
||||
|
||||
@ -877,20 +877,20 @@ class TableStructureController extends TableController
|
||||
}
|
||||
|
||||
$changes[] = 'CHANGE ' . Table::generateAlter(
|
||||
Util::getValueByKey($_REQUEST, "field_orig.${i}", ''),
|
||||
$_REQUEST['field_name'][$i],
|
||||
$_REQUEST['field_type'][$i],
|
||||
$_REQUEST['field_length'][$i],
|
||||
$_REQUEST['field_attribute'][$i],
|
||||
Util::getValueByKey($_REQUEST, "field_collation.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_null.${i}", 'NOT NULL'),
|
||||
$_REQUEST['field_default_type'][$i],
|
||||
$_REQUEST['field_default_value'][$i],
|
||||
Util::getValueByKey($_REQUEST, "field_extra.${i}", false),
|
||||
Util::getValueByKey($_REQUEST, "field_comments.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_virtuality.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_expression.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_move_to.${i}", '')
|
||||
Util::getValueByKey($_POST, "field_orig.${i}", ''),
|
||||
$_POST['field_name'][$i],
|
||||
$_POST['field_type'][$i],
|
||||
$_POST['field_length'][$i],
|
||||
$_POST['field_attribute'][$i],
|
||||
Util::getValueByKey($_POST, "field_collation.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_null.${i}", 'NOT NULL'),
|
||||
$_POST['field_default_type'][$i],
|
||||
$_POST['field_default_value'][$i],
|
||||
Util::getValueByKey($_POST, "field_extra.${i}", false),
|
||||
Util::getValueByKey($_POST, "field_comments.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_virtuality.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_expression.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_move_to.${i}", '')
|
||||
);
|
||||
|
||||
// find the remembered sort expression
|
||||
@ -900,22 +900,22 @@ class TableStructureController extends TableController
|
||||
// if the old column name is part of the remembered sort expression
|
||||
if (mb_strpos(
|
||||
$sorted_col,
|
||||
Util::backquote($_REQUEST['field_orig'][$i])
|
||||
Util::backquote($_POST['field_orig'][$i])
|
||||
) !== false) {
|
||||
// delete the whole remembered sort expression
|
||||
$this->table_obj->removeUiProp(Table::PROP_SORTED_COLUMN);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['field_adjust_privileges'][$i])
|
||||
&& ! empty($_REQUEST['field_adjust_privileges'][$i])
|
||||
&& $_REQUEST['field_orig'][$i] != $_REQUEST['field_name'][$i]
|
||||
if (isset($_POST['field_adjust_privileges'][$i])
|
||||
&& ! empty($_POST['field_adjust_privileges'][$i])
|
||||
&& $_POST['field_orig'][$i] != $_POST['field_name'][$i]
|
||||
) {
|
||||
$adjust_privileges[$_REQUEST['field_orig'][$i]]
|
||||
= $_REQUEST['field_name'][$i];
|
||||
$adjust_privileges[$_POST['field_orig'][$i]]
|
||||
= $_POST['field_name'][$i];
|
||||
}
|
||||
} // end for
|
||||
|
||||
if (count($changes) > 0 || isset($_REQUEST['preview_sql'])) {
|
||||
if (count($changes) > 0 || isset($_POST['preview_sql'])) {
|
||||
// Builds the primary keys statements and updates the table
|
||||
$key_query = '';
|
||||
/**
|
||||
@ -942,7 +942,7 @@ class TableStructureController extends TableController
|
||||
$sql_query .= ';';
|
||||
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
Core::previewSQL(count($changes) > 0 ? $sql_query : '');
|
||||
}
|
||||
|
||||
@ -957,18 +957,18 @@ class TableStructureController extends TableController
|
||||
// While changing the Column Collation
|
||||
// First change to BLOB
|
||||
for ($i = 0; $i < $field_cnt; $i++ ) {
|
||||
if (isset($_REQUEST['field_collation'][$i])
|
||||
&& isset($_REQUEST['field_collation_orig'][$i])
|
||||
&& $_REQUEST['field_collation'][$i] !== $_REQUEST['field_collation_orig'][$i]
|
||||
&& ! in_array($_REQUEST['field_orig'][$i], $columns_with_index)
|
||||
if (isset($_POST['field_collation'][$i])
|
||||
&& isset($_POST['field_collation_orig'][$i])
|
||||
&& $_POST['field_collation'][$i] !== $_POST['field_collation_orig'][$i]
|
||||
&& ! in_array($_POST['field_orig'][$i], $columns_with_index)
|
||||
) {
|
||||
$secondary_query = 'ALTER TABLE ' . Util::backquote(
|
||||
$this->table
|
||||
)
|
||||
. ' CHANGE ' . Util::backquote(
|
||||
$_REQUEST['field_orig'][$i]
|
||||
$_POST['field_orig'][$i]
|
||||
)
|
||||
. ' ' . Util::backquote($_REQUEST['field_orig'][$i])
|
||||
. ' ' . Util::backquote($_POST['field_orig'][$i])
|
||||
. ' BLOB;';
|
||||
$this->dbi->query($secondary_query);
|
||||
$changedToBlob[$i] = true;
|
||||
@ -1013,20 +1013,20 @@ class TableStructureController extends TableController
|
||||
for ($i = 0; $i < $field_cnt; $i++) {
|
||||
if ($changedToBlob[$i]) {
|
||||
$changes_revert[] = 'CHANGE ' . Table::generateAlter(
|
||||
Util::getValueByKey($_REQUEST, "field_orig.${i}", ''),
|
||||
$_REQUEST['field_name'][$i],
|
||||
$_REQUEST['field_type_orig'][$i],
|
||||
$_REQUEST['field_length_orig'][$i],
|
||||
$_REQUEST['field_attribute_orig'][$i],
|
||||
Util::getValueByKey($_REQUEST, "field_collation_orig.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_null_orig.${i}", 'NOT NULL'),
|
||||
$_REQUEST['field_default_type_orig'][$i],
|
||||
$_REQUEST['field_default_value_orig'][$i],
|
||||
Util::getValueByKey($_REQUEST, "field_extra_orig.${i}", false),
|
||||
Util::getValueByKey($_REQUEST, "field_comments_orig.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_virtuality_orig.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_expression_orig.${i}", ''),
|
||||
Util::getValueByKey($_REQUEST, "field_move_to_orig.${i}", '')
|
||||
Util::getValueByKey($_POST, "field_orig.${i}", ''),
|
||||
$_POST['field_name'][$i],
|
||||
$_POST['field_type_orig'][$i],
|
||||
$_POST['field_length_orig'][$i],
|
||||
$_POST['field_attribute_orig'][$i],
|
||||
Util::getValueByKey($_POST, "field_collation_orig.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_null_orig.${i}", 'NOT NULL'),
|
||||
$_POST['field_default_type_orig'][$i],
|
||||
$_POST['field_default_value_orig'][$i],
|
||||
Util::getValueByKey($_POST, "field_extra_orig.${i}", false),
|
||||
Util::getValueByKey($_POST, "field_comments_orig.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_virtuality_orig.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_expression_orig.${i}", ''),
|
||||
Util::getValueByKey($_POST, "field_move_to_orig.${i}", '')
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1051,34 +1051,34 @@ class TableStructureController extends TableController
|
||||
}
|
||||
|
||||
// update field names in relation
|
||||
if (isset($_REQUEST['field_orig']) && is_array($_REQUEST['field_orig'])) {
|
||||
foreach ($_REQUEST['field_orig'] as $fieldindex => $fieldcontent) {
|
||||
if ($_REQUEST['field_name'][$fieldindex] != $fieldcontent) {
|
||||
if (isset($_POST['field_orig']) && is_array($_POST['field_orig'])) {
|
||||
foreach ($_POST['field_orig'] as $fieldindex => $fieldcontent) {
|
||||
if ($_POST['field_name'][$fieldindex] != $fieldcontent) {
|
||||
$this->relation->renameField(
|
||||
$this->db, $this->table, $fieldcontent,
|
||||
$_REQUEST['field_name'][$fieldindex]
|
||||
$_POST['field_name'][$fieldindex]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update mime types
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
if (isset($_POST['field_mimetype'])
|
||||
&& is_array($_POST['field_mimetype'])
|
||||
&& $GLOBALS['cfg']['BrowseMIME']
|
||||
) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex]) > 0
|
||||
foreach ($_POST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_POST['field_name'][$fieldindex])
|
||||
&& strlen($_POST['field_name'][$fieldindex]) > 0
|
||||
) {
|
||||
Transformations::setMIME(
|
||||
$this->db, $this->table,
|
||||
$_REQUEST['field_name'][$fieldindex],
|
||||
$_POST['field_name'][$fieldindex],
|
||||
$mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
$_REQUEST['field_transformation_options'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation_options'][$fieldindex]
|
||||
$_POST['field_transformation'][$fieldindex],
|
||||
$_POST['field_transformation_options'][$fieldindex],
|
||||
$_POST['field_input_transformation'][$fieldindex],
|
||||
$_POST['field_input_transformation_options'][$fieldindex]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1143,15 +1143,15 @@ class TableStructureController extends TableController
|
||||
{
|
||||
// these two fields are checkboxes so might not be part of the
|
||||
// request; therefore we define them to avoid notices below
|
||||
if (! isset($_REQUEST['field_null'][$i])) {
|
||||
$_REQUEST['field_null'][$i] = 'NO';
|
||||
if (! isset($_POST['field_null'][$i])) {
|
||||
$_POST['field_null'][$i] = 'NO';
|
||||
}
|
||||
if (! isset($_REQUEST['field_extra'][$i])) {
|
||||
$_REQUEST['field_extra'][$i] = '';
|
||||
if (! isset($_POST['field_extra'][$i])) {
|
||||
$_POST['field_extra'][$i] = '';
|
||||
}
|
||||
|
||||
// field_name does not follow the convention (corresponds to field_orig)
|
||||
if ($_REQUEST['field_name'][$i] != $_REQUEST['field_orig'][$i]) {
|
||||
if ($_POST['field_name'][$i] != $_POST['field_orig'][$i]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1161,11 +1161,11 @@ class TableStructureController extends TableController
|
||||
'field_length', 'field_null', 'field_type'
|
||||
);
|
||||
foreach ($fields as $field) {
|
||||
if ($_REQUEST[$field][$i] != $_REQUEST[$field . '_orig'][$i]) {
|
||||
if ($_POST[$field][$i] != $_POST[$field . '_orig'][$i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return !empty($_REQUEST['field_move_to'][$i]);
|
||||
return !empty($_POST['field_move_to'][$i]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -42,12 +42,12 @@ class CreateAddField
|
||||
*/
|
||||
private function getIndexedColumns()
|
||||
{
|
||||
$fieldCount = count($_REQUEST['field_name']);
|
||||
$fieldPrimary = json_decode($_REQUEST['primary_indexes'], true);
|
||||
$fieldIndex = json_decode($_REQUEST['indexes'], true);
|
||||
$fieldUnique = json_decode($_REQUEST['unique_indexes'], true);
|
||||
$fieldFullText = json_decode($_REQUEST['fulltext_indexes'], true);
|
||||
$fieldSpatial = json_decode($_REQUEST['spatial_indexes'], true);
|
||||
$fieldCount = count($_POST['field_name']);
|
||||
$fieldPrimary = json_decode($_POST['primary_indexes'], true);
|
||||
$fieldIndex = json_decode($_POST['indexes'], true);
|
||||
$fieldUnique = json_decode($_POST['unique_indexes'], true);
|
||||
$fieldFullText = json_decode($_POST['fulltext_indexes'], true);
|
||||
$fieldSpatial = json_decode($_POST['spatial_indexes'], true);
|
||||
|
||||
return [
|
||||
$fieldCount,
|
||||
@ -78,35 +78,35 @@ class CreateAddField
|
||||
$previousField = -1;
|
||||
for ($i = 0; $i < $fieldCount; ++$i) {
|
||||
// '0' is also empty for php :-(
|
||||
if (strlen($_REQUEST['field_name'][$i]) === 0) {
|
||||
if (strlen($_POST['field_name'][$i]) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$definition = $this->getStatementPrefix($isCreateTable) .
|
||||
Table::generateFieldSpec(
|
||||
trim($_REQUEST['field_name'][$i]),
|
||||
$_REQUEST['field_type'][$i],
|
||||
$_REQUEST['field_length'][$i],
|
||||
$_REQUEST['field_attribute'][$i],
|
||||
isset($_REQUEST['field_collation'][$i])
|
||||
? $_REQUEST['field_collation'][$i]
|
||||
trim($_POST['field_name'][$i]),
|
||||
$_POST['field_type'][$i],
|
||||
$_POST['field_length'][$i],
|
||||
$_POST['field_attribute'][$i],
|
||||
isset($_POST['field_collation'][$i])
|
||||
? $_POST['field_collation'][$i]
|
||||
: '',
|
||||
isset($_REQUEST['field_null'][$i])
|
||||
? $_REQUEST['field_null'][$i]
|
||||
isset($_POST['field_null'][$i])
|
||||
? $_POST['field_null'][$i]
|
||||
: 'NOT NULL',
|
||||
$_REQUEST['field_default_type'][$i],
|
||||
$_REQUEST['field_default_value'][$i],
|
||||
isset($_REQUEST['field_extra'][$i])
|
||||
? $_REQUEST['field_extra'][$i]
|
||||
$_POST['field_default_type'][$i],
|
||||
$_POST['field_default_value'][$i],
|
||||
isset($_POST['field_extra'][$i])
|
||||
? $_POST['field_extra'][$i]
|
||||
: false,
|
||||
isset($_REQUEST['field_comments'][$i])
|
||||
? $_REQUEST['field_comments'][$i]
|
||||
isset($_POST['field_comments'][$i])
|
||||
? $_POST['field_comments'][$i]
|
||||
: '',
|
||||
isset($_REQUEST['field_virtuality'][$i])
|
||||
? $_REQUEST['field_virtuality'][$i]
|
||||
isset($_POST['field_virtuality'][$i])
|
||||
? $_POST['field_virtuality'][$i]
|
||||
: '',
|
||||
isset($_REQUEST['field_expression'][$i])
|
||||
? $_REQUEST['field_expression'][$i]
|
||||
isset($_POST['field_expression'][$i])
|
||||
? $_POST['field_expression'][$i]
|
||||
: ''
|
||||
);
|
||||
|
||||
@ -139,22 +139,22 @@ class CreateAddField
|
||||
return $sqlSuffix;
|
||||
}
|
||||
|
||||
if ((string) $_REQUEST['field_where'] === 'last') {
|
||||
if ((string) $_POST['field_where'] === 'last') {
|
||||
return $sqlSuffix;
|
||||
}
|
||||
|
||||
// Only the first field can be added somewhere other than at the end
|
||||
if ($previousField == -1) {
|
||||
if ((string) $_REQUEST['field_where'] === 'first') {
|
||||
if ((string) $_POST['field_where'] === 'first') {
|
||||
$sqlSuffix .= ' FIRST';
|
||||
} else {
|
||||
$sqlSuffix .= ' AFTER '
|
||||
. Util::backquote($_REQUEST['after_field']);
|
||||
. Util::backquote($_POST['after_field']);
|
||||
}
|
||||
} else {
|
||||
$sqlSuffix .= ' AFTER '
|
||||
. Util::backquote(
|
||||
$_REQUEST['field_name'][$previousField]
|
||||
$_POST['field_name'][$previousField]
|
||||
);
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ class CreateAddField
|
||||
$indexFields = [];
|
||||
foreach ($index['columns'] as $key => $column) {
|
||||
$indexFields[$key] = Util::backquote(
|
||||
$_REQUEST['field_name'][$column['col_index']]
|
||||
$_POST['field_name'][$column['col_index']]
|
||||
);
|
||||
if ($column['size']) {
|
||||
$indexFields[$key] .= '(' . $column['size'] . ')';
|
||||
@ -358,30 +358,30 @@ class CreateAddField
|
||||
public function getPartitionsDefinition()
|
||||
{
|
||||
$sqlQuery = "";
|
||||
if (! empty($_REQUEST['partition_by'])
|
||||
&& ! empty($_REQUEST['partition_expr'])
|
||||
&& ! empty($_REQUEST['partition_count'])
|
||||
&& $_REQUEST['partition_count'] > 1
|
||||
if (! empty($_POST['partition_by'])
|
||||
&& ! empty($_POST['partition_expr'])
|
||||
&& ! empty($_POST['partition_count'])
|
||||
&& $_POST['partition_count'] > 1
|
||||
) {
|
||||
$sqlQuery .= " PARTITION BY " . $_REQUEST['partition_by']
|
||||
. " (" . $_REQUEST['partition_expr'] . ")"
|
||||
. " PARTITIONS " . $_REQUEST['partition_count'];
|
||||
$sqlQuery .= " PARTITION BY " . $_POST['partition_by']
|
||||
. " (" . $_POST['partition_expr'] . ")"
|
||||
. " PARTITIONS " . $_POST['partition_count'];
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['subpartition_by'])
|
||||
&& ! empty($_REQUEST['subpartition_expr'])
|
||||
&& ! empty($_REQUEST['subpartition_count'])
|
||||
&& $_REQUEST['subpartition_count'] > 1
|
||||
if (! empty($_POST['subpartition_by'])
|
||||
&& ! empty($_POST['subpartition_expr'])
|
||||
&& ! empty($_POST['subpartition_count'])
|
||||
&& $_POST['subpartition_count'] > 1
|
||||
) {
|
||||
$sqlQuery .= " SUBPARTITION BY " . $_REQUEST['subpartition_by']
|
||||
. " (" . $_REQUEST['subpartition_expr'] . ")"
|
||||
. " SUBPARTITIONS " . $_REQUEST['subpartition_count'];
|
||||
$sqlQuery .= " SUBPARTITION BY " . $_POST['subpartition_by']
|
||||
. " (" . $_POST['subpartition_expr'] . ")"
|
||||
. " SUBPARTITIONS " . $_POST['subpartition_count'];
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['partitions'])) {
|
||||
if (! empty($_POST['partitions'])) {
|
||||
$i = 0;
|
||||
$partitions = [];
|
||||
foreach ($_REQUEST['partitions'] as $partition) {
|
||||
foreach ($_POST['partitions'] as $partition) {
|
||||
$partitions[] = $this->getPartitionDefinition($partition);
|
||||
$i++;
|
||||
}
|
||||
@ -471,24 +471,24 @@ class CreateAddField
|
||||
. Util::backquote(trim($table)) . ' (' . $sqlStatement . ')';
|
||||
|
||||
// Adds table type, character set, comments and partition definition
|
||||
if (!empty($_REQUEST['tbl_storage_engine'])
|
||||
&& ($_REQUEST['tbl_storage_engine'] != 'Default')
|
||||
if (!empty($_POST['tbl_storage_engine'])
|
||||
&& ($_POST['tbl_storage_engine'] != 'Default')
|
||||
) {
|
||||
$sqlQuery .= ' ENGINE = ' . $_REQUEST['tbl_storage_engine'];
|
||||
$sqlQuery .= ' ENGINE = ' . $_POST['tbl_storage_engine'];
|
||||
}
|
||||
if (!empty($_REQUEST['tbl_collation'])) {
|
||||
$sqlQuery .= Util::getCharsetQueryPart($_REQUEST['tbl_collation']);
|
||||
if (!empty($_POST['tbl_collation'])) {
|
||||
$sqlQuery .= Util::getCharsetQueryPart($_POST['tbl_collation']);
|
||||
}
|
||||
if (! empty($_REQUEST['connection'])
|
||||
&& ! empty($_REQUEST['tbl_storage_engine'])
|
||||
&& $_REQUEST['tbl_storage_engine'] == 'FEDERATED'
|
||||
if (! empty($_POST['connection'])
|
||||
&& ! empty($_POST['tbl_storage_engine'])
|
||||
&& $_POST['tbl_storage_engine'] == 'FEDERATED'
|
||||
) {
|
||||
$sqlQuery .= " CONNECTION = '"
|
||||
. $this->dbi->escapeString($_REQUEST['connection']) . "'";
|
||||
. $this->dbi->escapeString($_POST['connection']) . "'";
|
||||
}
|
||||
if (!empty($_REQUEST['comment'])) {
|
||||
if (!empty($_POST['comment'])) {
|
||||
$sqlQuery .= ' COMMENT = \''
|
||||
. $this->dbi->escapeString($_REQUEST['comment']) . '\'';
|
||||
. $this->dbi->escapeString($_POST['comment']) . '\'';
|
||||
}
|
||||
$sqlQuery .= $this->getPartitionsDefinition();
|
||||
$sqlQuery .= ';';
|
||||
@ -506,14 +506,14 @@ class CreateAddField
|
||||
// Limit to 4096 fields (MySQL maximal value)
|
||||
$mysqlLimit = 4096;
|
||||
|
||||
if (isset($_REQUEST['submit_num_fields'])) { // adding new fields
|
||||
$numberOfFields = intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']);
|
||||
} elseif (isset($_REQUEST['orig_num_fields'])) { // retaining existing fields
|
||||
$numberOfFields = intval($_REQUEST['orig_num_fields']);
|
||||
} elseif (isset($_REQUEST['num_fields'])
|
||||
&& intval($_REQUEST['num_fields']) > 0
|
||||
if (isset($_POST['submit_num_fields'])) { // adding new fields
|
||||
$numberOfFields = intval($_POST['orig_num_fields']) + intval($_POST['added_fields']);
|
||||
} elseif (isset($_POST['orig_num_fields'])) { // retaining existing fields
|
||||
$numberOfFields = intval($_POST['orig_num_fields']);
|
||||
} elseif (isset($_POST['num_fields'])
|
||||
&& intval($_POST['num_fields']) > 0
|
||||
) { // new table with specified number of fields
|
||||
$numberOfFields = intval($_REQUEST['num_fields']);
|
||||
$numberOfFields = intval($_POST['num_fields']);
|
||||
} else { // new table with unspecified number of fields
|
||||
$numberOfFields = 4;
|
||||
}
|
||||
@ -548,7 +548,7 @@ class CreateAddField
|
||||
$sqlQuery = 'ALTER TABLE ' .
|
||||
Util::backquote($table) . ' ' . $sqlStatement . ';';
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
Core::previewSQL($sqlQuery);
|
||||
}
|
||||
return [$this->dbi->tryQuery($sqlQuery), $sqlQuery];
|
||||
|
||||
@ -254,7 +254,7 @@ class Qbe
|
||||
}
|
||||
|
||||
$criterias = $this->_currentSearch->getCriterias();
|
||||
$_REQUEST = $criterias + $_REQUEST;
|
||||
$_POST = $criterias + $_POST;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -279,34 +279,34 @@ class Qbe
|
||||
$criteriaColumnCount = $this->_initializeCriteriasCount();
|
||||
|
||||
$this->_criteriaColumnInsert = Core::ifSetOr(
|
||||
$_REQUEST['criteriaColumnInsert'],
|
||||
$_POST['criteriaColumnInsert'],
|
||||
null,
|
||||
'array'
|
||||
);
|
||||
$this->_criteriaColumnDelete = Core::ifSetOr(
|
||||
$_REQUEST['criteriaColumnDelete'],
|
||||
$_POST['criteriaColumnDelete'],
|
||||
null,
|
||||
'array'
|
||||
);
|
||||
|
||||
$this->_prev_criteria = isset($_REQUEST['prev_criteria'])
|
||||
? $_REQUEST['prev_criteria']
|
||||
$this->_prev_criteria = isset($_POST['prev_criteria'])
|
||||
? $_POST['prev_criteria']
|
||||
: array();
|
||||
$this->_criteria = isset($_REQUEST['criteria'])
|
||||
? $_REQUEST['criteria']
|
||||
$this->_criteria = isset($_POST['criteria'])
|
||||
? $_POST['criteria']
|
||||
: array_fill(0, $criteriaColumnCount, '');
|
||||
|
||||
$this->_criteriaRowInsert = isset($_REQUEST['criteriaRowInsert'])
|
||||
? $_REQUEST['criteriaRowInsert']
|
||||
$this->_criteriaRowInsert = isset($_POST['criteriaRowInsert'])
|
||||
? $_POST['criteriaRowInsert']
|
||||
: array_fill(0, $criteriaColumnCount, '');
|
||||
$this->_criteriaRowDelete = isset($_REQUEST['criteriaRowDelete'])
|
||||
? $_REQUEST['criteriaRowDelete']
|
||||
$this->_criteriaRowDelete = isset($_POST['criteriaRowDelete'])
|
||||
? $_POST['criteriaRowDelete']
|
||||
: array_fill(0, $criteriaColumnCount, '');
|
||||
$this->_criteriaAndOrRow = isset($_REQUEST['criteriaAndOrRow'])
|
||||
? $_REQUEST['criteriaAndOrRow']
|
||||
$this->_criteriaAndOrRow = isset($_POST['criteriaAndOrRow'])
|
||||
? $_POST['criteriaAndOrRow']
|
||||
: array_fill(0, $criteriaColumnCount, '');
|
||||
$this->_criteriaAndOrColumn = isset($_REQUEST['criteriaAndOrColumn'])
|
||||
? $_REQUEST['criteriaAndOrColumn']
|
||||
$this->_criteriaAndOrColumn = isset($_POST['criteriaAndOrColumn'])
|
||||
? $_POST['criteriaAndOrColumn']
|
||||
: array_fill(0, $criteriaColumnCount, '');
|
||||
// sets minimum width
|
||||
$this->_form_column_width = 12;
|
||||
@ -326,8 +326,8 @@ class Qbe
|
||||
private function _setCriteriaTablesAndColumns()
|
||||
{
|
||||
// The tables list sent by a previously submitted form
|
||||
if (Core::isValid($_REQUEST['TableList'], 'array')) {
|
||||
foreach ($_REQUEST['TableList'] as $each_table) {
|
||||
if (Core::isValid($_POST['TableList'], 'array')) {
|
||||
foreach ($_POST['TableList'] as $each_table) {
|
||||
$this->_criteriaTables[$each_table] = ' selected="selected"';
|
||||
}
|
||||
} // end if
|
||||
@ -346,7 +346,7 @@ class Qbe
|
||||
$columns = $GLOBALS['dbi']->getColumns($this->_db, $table);
|
||||
|
||||
if (empty($this->_criteriaTables[$table])
|
||||
&& ! empty($_REQUEST['TableList'])
|
||||
&& ! empty($_POST['TableList'])
|
||||
) {
|
||||
$this->_criteriaTables[$table] = '';
|
||||
} else {
|
||||
@ -475,10 +475,10 @@ class Qbe
|
||||
continue;
|
||||
}
|
||||
$selected = '';
|
||||
if (isset($_REQUEST['criteriaColumn'][$column_index])) {
|
||||
$selected = $_REQUEST['criteriaColumn'][$column_index];
|
||||
if (isset($_POST['criteriaColumn'][$column_index])) {
|
||||
$selected = $_POST['criteriaColumn'][$column_index];
|
||||
$this->_formColumns[$new_column_count]
|
||||
= $_REQUEST['criteriaColumn'][$column_index];
|
||||
= $_POST['criteriaColumn'][$column_index];
|
||||
}
|
||||
$html_output .= $this->_showColumnSelectCell(
|
||||
$new_column_count,
|
||||
@ -526,10 +526,10 @@ class Qbe
|
||||
}
|
||||
|
||||
$tmp_alias = '';
|
||||
if (! empty($_REQUEST['criteriaAlias'][$colInd])) {
|
||||
if (! empty($_POST['criteriaAlias'][$colInd])) {
|
||||
$tmp_alias
|
||||
= $this->_formAliases[$new_column_count]
|
||||
= $_REQUEST['criteriaAlias'][$colInd];
|
||||
= $_POST['criteriaAlias'][$colInd];
|
||||
}// end if
|
||||
|
||||
$html_output .= '<td class="center">';
|
||||
@ -575,21 +575,21 @@ class Qbe
|
||||
}
|
||||
// If they have chosen all fields using the * selector,
|
||||
// then sorting is not available, Fix for Bug #570698
|
||||
if (isset($_REQUEST['criteriaSort'][$colInd])
|
||||
&& isset($_REQUEST['criteriaColumn'][$colInd])
|
||||
&& mb_substr($_REQUEST['criteriaColumn'][$colInd], -2) == '.*'
|
||||
if (isset($_POST['criteriaSort'][$colInd])
|
||||
&& isset($_POST['criteriaColumn'][$colInd])
|
||||
&& mb_substr($_POST['criteriaColumn'][$colInd], -2) == '.*'
|
||||
) {
|
||||
$_REQUEST['criteriaSort'][$colInd] = '';
|
||||
$_POST['criteriaSort'][$colInd] = '';
|
||||
} //end if
|
||||
|
||||
$selected = '';
|
||||
if (isset($_REQUEST['criteriaSort'][$colInd])) {
|
||||
if (isset($_POST['criteriaSort'][$colInd])) {
|
||||
$this->_formSorts[$new_column_count]
|
||||
= $_REQUEST['criteriaSort'][$colInd];
|
||||
= $_POST['criteriaSort'][$colInd];
|
||||
|
||||
if ($_REQUEST['criteriaSort'][$colInd] == 'ASC') {
|
||||
if ($_POST['criteriaSort'][$colInd] == 'ASC') {
|
||||
$selected = 'ASC';
|
||||
} elseif ($_REQUEST['criteriaSort'][$colInd] == 'DESC') {
|
||||
} elseif ($_POST['criteriaSort'][$colInd] == 'DESC') {
|
||||
$selected = 'DESC';
|
||||
}
|
||||
} else {
|
||||
@ -639,10 +639,10 @@ class Qbe
|
||||
}
|
||||
|
||||
$sortOrder = null;
|
||||
if (! empty($_REQUEST['criteriaSortOrder'][$colInd])) {
|
||||
if (! empty($_POST['criteriaSortOrder'][$colInd])) {
|
||||
$sortOrder
|
||||
= $this->_formSortOrders[$new_column_count]
|
||||
= $_REQUEST['criteriaSortOrder'][$colInd];
|
||||
= $_POST['criteriaSortOrder'][$colInd];
|
||||
}
|
||||
|
||||
$html_output .= $this->_getSortOrderSelectCell(
|
||||
@ -685,10 +685,10 @@ class Qbe
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (isset($_REQUEST['criteriaShow'][$column_index])) {
|
||||
if (isset($_POST['criteriaShow'][$column_index])) {
|
||||
$checked_options = ' checked="checked"';
|
||||
$this->_formShows[$new_column_count]
|
||||
= $_REQUEST['criteriaShow'][$column_index];
|
||||
= $_POST['criteriaShow'][$column_index];
|
||||
} else {
|
||||
$checked_options = '';
|
||||
}
|
||||
@ -1007,8 +1007,8 @@ class Qbe
|
||||
continue;
|
||||
}
|
||||
$or = 'Or' . $new_row_index;
|
||||
if (! empty($_REQUEST[$or]) && isset($_REQUEST[$or][$column_index])) {
|
||||
$tmp_or = $_REQUEST[$or][$column_index];
|
||||
if (! empty($_POST[$or]) && isset($_POST[$or][$column_index])) {
|
||||
$tmp_or = $_POST[$or][$column_index];
|
||||
} else {
|
||||
$tmp_or = '';
|
||||
}
|
||||
@ -1177,7 +1177,7 @@ class Qbe
|
||||
$column_index++
|
||||
) {
|
||||
if (! empty($this->_formColumns[$column_index])
|
||||
&& ! empty($_REQUEST['Or' . $row_index][$column_index])
|
||||
&& ! empty($_POST['Or' . $row_index][$column_index])
|
||||
&& $column_index
|
||||
) {
|
||||
$qry_orwhere .= ' '
|
||||
@ -1187,11 +1187,11 @@ class Qbe
|
||||
. ' ';
|
||||
}
|
||||
if (! empty($this->_formColumns[$column_index])
|
||||
&& ! empty($_REQUEST['Or' . $row_index][$column_index])
|
||||
&& ! empty($_POST['Or' . $row_index][$column_index])
|
||||
) {
|
||||
$qry_orwhere .= '(' . $this->_formColumns[$column_index]
|
||||
. ' '
|
||||
. $_REQUEST['Or' . $row_index][$column_index]
|
||||
. $_POST['Or' . $row_index][$column_index]
|
||||
. ')';
|
||||
$last_orwhere = $column_index;
|
||||
$criteria_cnt++;
|
||||
@ -1901,12 +1901,12 @@ class Qbe
|
||||
{
|
||||
// sets column count
|
||||
$criteriaColumnCount = Core::ifSetOr(
|
||||
$_REQUEST['criteriaColumnCount'],
|
||||
$_POST['criteriaColumnCount'],
|
||||
3,
|
||||
'numeric'
|
||||
);
|
||||
$criteriaColumnAdd = Core::ifSetOr(
|
||||
$_REQUEST['criteriaColumnAdd'],
|
||||
$_POST['criteriaColumnAdd'],
|
||||
0,
|
||||
'numeric'
|
||||
);
|
||||
@ -1916,8 +1916,8 @@ class Qbe
|
||||
);
|
||||
|
||||
// sets row count
|
||||
$rows = Core::ifSetOr($_REQUEST['rows'], 0, 'numeric');
|
||||
$criteriaRowAdd = Core::ifSetOr($_REQUEST['criteriaRowAdd'], 0, 'numeric');
|
||||
$rows = Core::ifSetOr($_POST['rows'], 0, 'numeric');
|
||||
$criteriaRowAdd = Core::ifSetOr($_POST['criteriaRowAdd'], 0, 'numeric');
|
||||
$this->_criteria_row_count = min(
|
||||
100,
|
||||
max($rows + $criteriaRowAdd, 0)
|
||||
|
||||
@ -109,48 +109,48 @@ class Search
|
||||
{
|
||||
$this->tablesNamesOnly = $GLOBALS['dbi']->getTables($this->db);
|
||||
|
||||
if (empty($_REQUEST['criteriaSearchType'])
|
||||
|| ! is_string($_REQUEST['criteriaSearchType'])
|
||||
if (empty($_POST['criteriaSearchType'])
|
||||
|| ! is_string($_POST['criteriaSearchType'])
|
||||
|| ! array_key_exists(
|
||||
$_REQUEST['criteriaSearchType'],
|
||||
$_POST['criteriaSearchType'],
|
||||
$this->searchTypes
|
||||
)
|
||||
) {
|
||||
$this->criteriaSearchType = 1;
|
||||
unset($_REQUEST['submit_search']);
|
||||
unset($_POST['submit_search']);
|
||||
} else {
|
||||
$this->criteriaSearchType = (int) $_REQUEST['criteriaSearchType'];
|
||||
$this->criteriaSearchType = (int) $_POST['criteriaSearchType'];
|
||||
$this->searchTypeDescription
|
||||
= $this->searchTypes[$_REQUEST['criteriaSearchType']];
|
||||
= $this->searchTypes[$_POST['criteriaSearchType']];
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['criteriaSearchString'])
|
||||
|| ! is_string($_REQUEST['criteriaSearchString'])
|
||||
if (empty($_POST['criteriaSearchString'])
|
||||
|| ! is_string($_POST['criteriaSearchString'])
|
||||
) {
|
||||
$this->criteriaSearchString = '';
|
||||
unset($_REQUEST['submit_search']);
|
||||
unset($_POST['submit_search']);
|
||||
} else {
|
||||
$this->criteriaSearchString = $_REQUEST['criteriaSearchString'];
|
||||
$this->criteriaSearchString = $_POST['criteriaSearchString'];
|
||||
}
|
||||
|
||||
$this->criteriaTables = array();
|
||||
if (empty($_REQUEST['criteriaTables'])
|
||||
|| ! is_array($_REQUEST['criteriaTables'])
|
||||
if (empty($_POST['criteriaTables'])
|
||||
|| ! is_array($_POST['criteriaTables'])
|
||||
) {
|
||||
unset($_REQUEST['submit_search']);
|
||||
unset($_POST['submit_search']);
|
||||
} else {
|
||||
$this->criteriaTables = array_intersect(
|
||||
$_REQUEST['criteriaTables'], $this->tablesNamesOnly
|
||||
$_POST['criteriaTables'], $this->tablesNamesOnly
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['criteriaColumnName'])
|
||||
|| ! is_string($_REQUEST['criteriaColumnName'])
|
||||
if (empty($_POST['criteriaColumnName'])
|
||||
|| ! is_string($_POST['criteriaColumnName'])
|
||||
) {
|
||||
unset($this->criteriaColumnName);
|
||||
} else {
|
||||
$this->criteriaColumnName = $GLOBALS['dbi']->escapeString(
|
||||
$_REQUEST['criteriaColumnName']
|
||||
$_POST['criteriaColumnName']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,11 +62,11 @@ class Export
|
||||
*/
|
||||
public function getHtmlForSelectOptions($tmpSelect = '')
|
||||
{
|
||||
// Check if the selected databases are defined in $_GET
|
||||
// Check if the selected databases are defined in $_POST
|
||||
// (from clicking Back button on export.php)
|
||||
if (isset($_GET['db_select'])) {
|
||||
$_GET['db_select'] = urldecode($_GET['db_select']);
|
||||
$_GET['db_select'] = explode(",", $_GET['db_select']);
|
||||
if (isset($_POST['db_select'])) {
|
||||
$_POST['db_select'] = urldecode($_POST['db_select']);
|
||||
$_POST['db_select'] = explode(",", $_POST['db_select']);
|
||||
}
|
||||
|
||||
$databases = [];
|
||||
@ -75,8 +75,8 @@ class Export
|
||||
continue;
|
||||
}
|
||||
$isSelected = false;
|
||||
if (isset($_GET['db_select'])) {
|
||||
if (in_array($currentDb, $_GET['db_select'])) {
|
||||
if (isset($_POST['db_select'])) {
|
||||
if (in_array($currentDb, $_POST['db_select'])) {
|
||||
$isSelected = true;
|
||||
}
|
||||
} elseif (!empty($tmpSelect)) {
|
||||
@ -121,14 +121,14 @@ class Export
|
||||
global $cfg;
|
||||
|
||||
// If the export method was not set, the default is quick
|
||||
if (isset($_GET['export_method'])) {
|
||||
$cfg['Export']['method'] = $_GET['export_method'];
|
||||
if (isset($_POST['export_method'])) {
|
||||
$cfg['Export']['method'] = $_POST['export_method'];
|
||||
} elseif (! isset($cfg['Export']['method'])) {
|
||||
$cfg['Export']['method'] = 'quick';
|
||||
}
|
||||
|
||||
if (empty($sqlQuery) && isset($_GET['sql_query'])) {
|
||||
$sqlQuery = $_GET['sql_query'];
|
||||
if (empty($sqlQuery) && isset($_POST['sql_query'])) {
|
||||
$sqlQuery = $_POST['sql_query'];
|
||||
}
|
||||
|
||||
return Template::get('display/export/hidden_inputs')->render([
|
||||
@ -138,7 +138,7 @@ class Export
|
||||
'export_method' => $cfg['Export']['method'],
|
||||
'single_table' => $singleTable,
|
||||
'sql_query' => $sqlQuery,
|
||||
'template_id' => isset($_GET['template_id']) ? $_GET['template_id'] : '',
|
||||
'template_id' => isset($_POST['template_id']) ? $_POST['template_id'] : '',
|
||||
]);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ class Export
|
||||
|
||||
return Template::get('display/export/template_options')->render([
|
||||
'templates' => $templates,
|
||||
'selected_template' => !empty($_GET['template_id']) ? $_GET['template_id'] : null,
|
||||
'selected_template' => !empty($_POST['template_id']) ? $_POST['template_id'] : null,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -188,8 +188,8 @@ class Export
|
||||
private function getHtmlForOptionsMethod()
|
||||
{
|
||||
global $cfg;
|
||||
if (isset($_GET['quick_or_custom'])) {
|
||||
$exportMethod = $_GET['quick_or_custom'];
|
||||
if (isset($_POST['quick_or_custom'])) {
|
||||
$exportMethod = $_POST['quick_or_custom'];
|
||||
} else {
|
||||
$exportMethod = $cfg['Export']['method'];
|
||||
}
|
||||
@ -264,9 +264,9 @@ class Export
|
||||
$numberOfRows = $tableObject->countRecords();
|
||||
|
||||
return Template::get('display/export/options_rows')->render([
|
||||
'allrows' => isset($_GET['allrows']) ? $_GET['allrows'] : null,
|
||||
'limit_to' => isset($_GET['limit_to']) ? $_GET['limit_to'] : null,
|
||||
'limit_from' => isset($_GET['limit_from']) ? $_GET['limit_from'] : null,
|
||||
'allrows' => isset($_POST['allrows']) ? $_POST['allrows'] : null,
|
||||
'limit_to' => isset($_POST['limit_to']) ? $_POST['limit_to'] : null,
|
||||
'limit_from' => isset($_POST['limit_from']) ? $_POST['limit_from'] : null,
|
||||
'unlim_num_rows' => $unlimNumRows,
|
||||
'number_of_rows' => $numberOfRows,
|
||||
]);
|
||||
@ -357,8 +357,8 @@ class Export
|
||||
);
|
||||
$msg->addParamHtml('</a>');
|
||||
|
||||
if (isset($_GET['filename_template'])) {
|
||||
$filenameTemplate = $_GET['filename_template'];
|
||||
if (isset($_POST['filename_template'])) {
|
||||
$filenameTemplate = $_POST['filename_template'];
|
||||
} else {
|
||||
if ($exportType == 'database') {
|
||||
$filenameTemplate = $GLOBALS['PMA_Config']->getUserValue(
|
||||
@ -408,8 +408,8 @@ class Export
|
||||
private function getHtmlForOptionsOutputCompression()
|
||||
{
|
||||
global $cfg;
|
||||
if (isset($_GET['compression'])) {
|
||||
$selectedCompression = $_GET['compression'];
|
||||
if (isset($_POST['compression'])) {
|
||||
$selectedCompression = $_POST['compression'];
|
||||
} elseif (isset($cfg['Export']['compression'])) {
|
||||
$selectedCompression = $cfg['Export']['compression'];
|
||||
} else {
|
||||
@ -442,7 +442,7 @@ class Export
|
||||
private function getHtmlForOptionsOutputRadio()
|
||||
{
|
||||
return Template::get('display/export/options_output_radio')->render([
|
||||
'has_repopulate' => isset($_GET['repopulate']),
|
||||
'has_repopulate' => isset($_POST['repopulate']),
|
||||
'export_asfile' => $GLOBALS['cfg']['Export']['asfile'],
|
||||
]);
|
||||
}
|
||||
@ -505,8 +505,8 @@ class Export
|
||||
'export_type' => $exportType,
|
||||
'is_checked_lock_tables' => $isCheckedLockTables,
|
||||
'is_checked_asfile' => $isCheckedAsfile,
|
||||
'repopulate' => isset($_GET['repopulate']),
|
||||
'lock_tables' => isset($_GET['lock_tables']),
|
||||
'repopulate' => isset($_POST['repopulate']),
|
||||
'lock_tables' => isset($_POST['lock_tables']),
|
||||
'save_dir' => isset($cfg['SaveDir']) ? $cfg['SaveDir'] : null,
|
||||
'is_encoding_supported' => Encoding::isSupported(),
|
||||
'options_output_save_dir' => $optionsOutputSaveDir,
|
||||
@ -658,8 +658,8 @@ class Export
|
||||
) {
|
||||
$cfgRelation = $this->relation->getRelationsParam();
|
||||
|
||||
if (isset($_REQUEST['single_table'])) {
|
||||
$GLOBALS['single_table'] = $_REQUEST['single_table'];
|
||||
if (isset($_POST['single_table'])) {
|
||||
$GLOBALS['single_table'] = $_POST['single_table'];
|
||||
}
|
||||
|
||||
/* Scan for plugins */
|
||||
@ -731,8 +731,8 @@ class Export
|
||||
*/
|
||||
public function handleTemplateActions(array $cfgRelation)
|
||||
{
|
||||
if (isset($_REQUEST['templateId'])) {
|
||||
$id = $GLOBALS['dbi']->escapeString($_REQUEST['templateId']);
|
||||
if (isset($_POST['templateId'])) {
|
||||
$id = $GLOBALS['dbi']->escapeString($_POST['templateId']);
|
||||
} else {
|
||||
$id = '';
|
||||
}
|
||||
@ -741,16 +741,16 @@ class Export
|
||||
. Util::backquote($cfgRelation['export_templates']);
|
||||
$user = $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']);
|
||||
|
||||
switch ($_REQUEST['templateAction']) {
|
||||
switch ($_POST['templateAction']) {
|
||||
case 'create':
|
||||
$query = "INSERT INTO " . $templateTable . "("
|
||||
. " `username`, `export_type`,"
|
||||
. " `template_name`, `template_data`"
|
||||
. ") VALUES ("
|
||||
. "'" . $user . "', "
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['exportType'])
|
||||
. "', '" . $GLOBALS['dbi']->escapeString($_REQUEST['templateName'])
|
||||
. "', '" . $GLOBALS['dbi']->escapeString($_REQUEST['templateData'])
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_POST['exportType'])
|
||||
. "', '" . $GLOBALS['dbi']->escapeString($_POST['templateName'])
|
||||
. "', '" . $GLOBALS['dbi']->escapeString($_POST['templateData'])
|
||||
. "');";
|
||||
break;
|
||||
case 'load':
|
||||
@ -759,7 +759,7 @@ class Export
|
||||
break;
|
||||
case 'update':
|
||||
$query = "UPDATE " . $templateTable . " SET `template_data` = "
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['templateData']) . "'"
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_POST['templateData']) . "'"
|
||||
. " WHERE `id` = " . $id . " AND `username` = '" . $user . "'";
|
||||
break;
|
||||
case 'delete':
|
||||
@ -782,12 +782,12 @@ class Export
|
||||
}
|
||||
|
||||
$response->setRequestStatus(true);
|
||||
if ('create' == $_REQUEST['templateAction']) {
|
||||
if ('create' == $_POST['templateAction']) {
|
||||
$response->addJSON(
|
||||
'data',
|
||||
$this->getOptionsForTemplates($_REQUEST['exportType'])
|
||||
$this->getOptionsForTemplates($_POST['exportType'])
|
||||
);
|
||||
} elseif ('load' == $_REQUEST['templateAction']) {
|
||||
} elseif ('load' == $_POST['templateAction']) {
|
||||
$data = null;
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc(
|
||||
$result, DatabaseInterface::CONNECT_CONTROL
|
||||
|
||||
@ -3939,13 +3939,13 @@ class Results
|
||||
}
|
||||
|
||||
// as this is a form value, the type is always string so we cannot
|
||||
// use Core::isValid($_REQUEST['session_max_rows'], 'integer')
|
||||
if (Core::isValid($_REQUEST['session_max_rows'], 'numeric')) {
|
||||
$query['max_rows'] = (int)$_REQUEST['session_max_rows'];
|
||||
unset($_REQUEST['session_max_rows']);
|
||||
} elseif ($_REQUEST['session_max_rows'] == self::ALL_ROWS) {
|
||||
// use Core::isValid($_POST['session_max_rows'], 'integer')
|
||||
if (Core::isValid($_POST['session_max_rows'], 'numeric')) {
|
||||
$query['max_rows'] = (int)$_POST['session_max_rows'];
|
||||
unset($_POST['session_max_rows']);
|
||||
} elseif ($_POST['session_max_rows'] == self::ALL_ROWS) {
|
||||
$query['max_rows'] = self::ALL_ROWS;
|
||||
unset($_REQUEST['session_max_rows']);
|
||||
unset($_POST['session_max_rows']);
|
||||
} elseif (empty($query['max_rows'])) {
|
||||
$query['max_rows'] = intval($GLOBALS['cfg']['MaxRows']);
|
||||
}
|
||||
|
||||
@ -88,10 +88,10 @@ class ErrorReport
|
||||
];
|
||||
|
||||
if ($exceptionType == 'js') {
|
||||
if (empty($_REQUEST['exception'])) {
|
||||
if (empty($_POST['exception'])) {
|
||||
return [];
|
||||
}
|
||||
$exception = $_REQUEST['exception'];
|
||||
$exception = $_POST['exception'];
|
||||
$exception["stack"] = $this->translateStacktrace($exception["stack"]);
|
||||
list($uri, $scriptName) = $this->sanitizeUrl($exception["url"]);
|
||||
$exception["uri"] = $uri;
|
||||
@ -100,10 +100,10 @@ class ErrorReport
|
||||
$report["exception_type"] = 'js';
|
||||
$report["exception"] = $exception;
|
||||
$report["script_name"] = $scriptName;
|
||||
$report["microhistory"] = $_REQUEST['microhistory'];
|
||||
$report["microhistory"] = $_POST['microhistory'];
|
||||
|
||||
if (! empty($_REQUEST['description'])) {
|
||||
$report['steps'] = $_REQUEST['description'];
|
||||
if (! empty($_POST['description'])) {
|
||||
$report['steps'] = $_POST['description'];
|
||||
}
|
||||
} elseif ($exceptionType == 'php') {
|
||||
$errors = [];
|
||||
|
||||
@ -341,9 +341,9 @@ class Export
|
||||
. preg_replace('@[/\\\\]@', '_', $filename);
|
||||
|
||||
if (@file_exists($save_filename)
|
||||
&& ((! $quick_export && empty($_REQUEST['onserver_overwrite']))
|
||||
&& ((! $quick_export && empty($_POST['onserver_overwrite']))
|
||||
|| ($quick_export
|
||||
&& $_REQUEST['quick_export_onserver_overwrite'] != 'saveitover'))
|
||||
&& $_POST['quick_export_onserver_overwrite'] != 'saveitover'))
|
||||
) {
|
||||
$message = Message::error(
|
||||
__(
|
||||
@ -469,45 +469,45 @@ class Export
|
||||
$html = '<div>';
|
||||
|
||||
/**
|
||||
* Displays a back button with all the $_REQUEST data in the URL
|
||||
* Displays a back button with all the $_POST data in the URL
|
||||
* (store in a variable to also display after the textarea)
|
||||
*/
|
||||
$back_button = '<p id="export_back_button">[ <a href="';
|
||||
if ($export_type == 'server') {
|
||||
$back_button .= 'server_export.php' . Url::getCommon();
|
||||
$back_button .= 'server_export.php" data-post="' . Url::getCommon([], '');
|
||||
} elseif ($export_type == 'database') {
|
||||
$back_button .= 'db_export.php' . Url::getCommon(array('db' => $db));
|
||||
$back_button .= 'db_export.php" data-post="' . Url::getCommon(array('db' => $db), '');
|
||||
} else {
|
||||
$back_button .= 'tbl_export.php' . Url::getCommon(
|
||||
$back_button .= 'tbl_export.php" data-post="' . Url::getCommon(
|
||||
array(
|
||||
'db' => $db, 'table' => $table
|
||||
)
|
||||
), ''
|
||||
);
|
||||
}
|
||||
|
||||
// Convert the multiple select elements from an array to a string
|
||||
if ($export_type == 'server' && isset($_REQUEST['db_select'])) {
|
||||
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
|
||||
if ($export_type == 'server' && isset($_POST['db_select'])) {
|
||||
$_POST['db_select'] = implode(",", $_POST['db_select']);
|
||||
} elseif ($export_type == 'database') {
|
||||
if (isset($_REQUEST['table_select'])) {
|
||||
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
|
||||
if (isset($_POST['table_select'])) {
|
||||
$_POST['table_select'] = implode(",", $_POST['table_select']);
|
||||
}
|
||||
if (isset($_REQUEST['table_structure'])) {
|
||||
$_REQUEST['table_structure'] = implode(
|
||||
if (isset($_POST['table_structure'])) {
|
||||
$_POST['table_structure'] = implode(
|
||||
",",
|
||||
$_REQUEST['table_structure']
|
||||
$_POST['table_structure']
|
||||
);
|
||||
} elseif (empty($_REQUEST['structure_or_data_forced'])) {
|
||||
$_REQUEST['table_structure'] = '';
|
||||
} elseif (empty($_POST['structure_or_data_forced'])) {
|
||||
$_POST['table_structure'] = '';
|
||||
}
|
||||
if (isset($_REQUEST['table_data'])) {
|
||||
$_REQUEST['table_data'] = implode(",", $_REQUEST['table_data']);
|
||||
} elseif (empty($_REQUEST['structure_or_data_forced'])) {
|
||||
$_REQUEST['table_data'] = '';
|
||||
if (isset($_POST['table_data'])) {
|
||||
$_POST['table_data'] = implode(",", $_POST['table_data']);
|
||||
} elseif (empty($_POST['structure_or_data_forced'])) {
|
||||
$_POST['table_data'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_REQUEST as $name => $value) {
|
||||
foreach ($_POST as $name => $value) {
|
||||
if (!is_array($value)) {
|
||||
$back_button .= '&' . urlencode($name) . '=' . urlencode($value);
|
||||
}
|
||||
|
||||
@ -161,28 +161,28 @@ class Footer
|
||||
'target' => $target
|
||||
);
|
||||
// needed for server privileges tabs
|
||||
if (isset($_REQUEST['viewing_mode'])
|
||||
&& in_array($_REQUEST['viewing_mode'], array('server', 'db', 'table'))
|
||||
if (isset($_GET['viewing_mode'])
|
||||
&& in_array($_GET['viewing_mode'], array('server', 'db', 'table'))
|
||||
) {
|
||||
$params['viewing_mode'] = $_REQUEST['viewing_mode'];
|
||||
$params['viewing_mode'] = $_GET['viewing_mode'];
|
||||
}
|
||||
/*
|
||||
* @todo coming from server_privileges.php, here $db is not set,
|
||||
* add the following condition below when that is fixed
|
||||
* && $_REQUEST['checkprivsdb'] == $db
|
||||
* && $_GET['checkprivsdb'] == $db
|
||||
*/
|
||||
if (isset($_REQUEST['checkprivsdb'])
|
||||
if (isset($_GET['checkprivsdb'])
|
||||
) {
|
||||
$params['checkprivsdb'] = $_REQUEST['checkprivsdb'];
|
||||
$params['checkprivsdb'] = $_GET['checkprivsdb'];
|
||||
}
|
||||
/*
|
||||
* @todo coming from server_privileges.php, here $table is not set,
|
||||
* add the following condition below when that is fixed
|
||||
* && $_REQUEST['checkprivstable'] == $table
|
||||
*/
|
||||
if (isset($_REQUEST['checkprivstable'])
|
||||
if (isset($_GET['checkprivstable'])
|
||||
) {
|
||||
$params['checkprivstable'] = $_REQUEST['checkprivstable'];
|
||||
$params['checkprivstable'] = $_GET['checkprivstable'];
|
||||
}
|
||||
if (isset($_REQUEST['single_table'])
|
||||
&& in_array($_REQUEST['single_table'], array(true, false))
|
||||
|
||||
@ -286,7 +286,7 @@ class Import
|
||||
$import_run_buffer = self::runQueryPost($import_run_buffer, $sql, $full);
|
||||
|
||||
// In case of ROLLBACK, notify the user.
|
||||
if (isset($_REQUEST['rollback_query'])) {
|
||||
if (isset($_POST['rollback_query'])) {
|
||||
$msg .= __('[ROLLBACK occurred.]');
|
||||
}
|
||||
}
|
||||
@ -1343,7 +1343,7 @@ class Import
|
||||
$response = Response::getInstance();
|
||||
$error = false;
|
||||
$error_msg = __('Only single-table UPDATE and DELETE queries can be simulated.');
|
||||
$sql_delimiter = $_REQUEST['sql_delimiter'];
|
||||
$sql_delimiter = $_POST['sql_delimiter'];
|
||||
$sql_data = array();
|
||||
$queries = explode($sql_delimiter, $GLOBALS['sql_query']);
|
||||
foreach ($queries as $sql_query) {
|
||||
@ -1565,7 +1565,7 @@ class Import
|
||||
*/
|
||||
public static function handleRollbackRequest($sql_query)
|
||||
{
|
||||
$sql_delimiter = $_REQUEST['sql_delimiter'];
|
||||
$sql_delimiter = $_POST['sql_delimiter'];
|
||||
$queries = explode($sql_delimiter, $sql_query);
|
||||
$error = false;
|
||||
$error_msg = __(
|
||||
@ -1590,7 +1590,7 @@ class Import
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
unset($_REQUEST['rollback_query']);
|
||||
unset($_POST['rollback_query']);
|
||||
$response = Response::getInstance();
|
||||
$message = Message::rawError($error);
|
||||
$response->addJSON('message', $message);
|
||||
|
||||
@ -741,7 +741,7 @@ class Index
|
||||
$r .= '" ' . $row_span . '>'
|
||||
. ' <a class="';
|
||||
$r .= 'ajax';
|
||||
$r .= '" href="tbl_indexes.php' . Url::getCommon($this_params)
|
||||
$r .= '" href="tbl_indexes.php" data-post="' . Url::getCommon($this_params, '')
|
||||
. '">' . Util::getIcon('b_edit', __('Edit')) . '</a>'
|
||||
. '</td>' . "\n";
|
||||
$this_params = $GLOBALS['url_params'];
|
||||
|
||||
@ -79,8 +79,8 @@ class InsertEdit
|
||||
$_form_params['where_clause[' . $key_id . ']'] = trim($where_clause);
|
||||
}
|
||||
}
|
||||
if (isset($_REQUEST['clause_is_unique'])) {
|
||||
$_form_params['clause_is_unique'] = $_REQUEST['clause_is_unique'];
|
||||
if (isset($_POST['clause_is_unique'])) {
|
||||
$_form_params['clause_is_unique'] = $_POST['clause_is_unique'];
|
||||
}
|
||||
return $_form_params;
|
||||
}
|
||||
@ -280,13 +280,13 @@ class InsertEdit
|
||||
$this_url_params = array_merge($url_params, $params);
|
||||
|
||||
if (! $is_show) {
|
||||
return ' : <a href="tbl_change.php'
|
||||
. Url::getCommon($this_url_params) . '">'
|
||||
return ' : <a href="tbl_change.php" data-post="'
|
||||
. Url::getCommon($this_url_params, '') . '">'
|
||||
. $this->showTypeOrFunctionLabel($which)
|
||||
. '</a>';
|
||||
}
|
||||
return '<th><a href="tbl_change.php'
|
||||
. Url::getCommon($this_url_params)
|
||||
return '<th><a href="tbl_change.php" data-post="'
|
||||
. Url::getCommon($this_url_params, '')
|
||||
. '" title="' . __('Hide') . '">'
|
||||
. $this->showTypeOrFunctionLabel($which)
|
||||
. '</a></th>';
|
||||
@ -849,7 +849,7 @@ class InsertEdit
|
||||
. 'id="field_' . ($idindex) . '_3" '
|
||||
. 'value="' . htmlspecialchars($data) . '" />';
|
||||
|
||||
$html_output .= '<a class="ajax browse_foreign" href="browse_foreigners.php'
|
||||
$html_output .= '<a class="ajax browse_foreign" href="browse_foreigners.php" data-post="'
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'db' => $db,
|
||||
@ -857,7 +857,8 @@ class InsertEdit
|
||||
'field' => $column['Field'],
|
||||
'rownumber' => $rownumber,
|
||||
'data' => $data
|
||||
)
|
||||
),
|
||||
''
|
||||
) . '">'
|
||||
. str_replace("'", "\'", $titles['Browse']) . '</a>';
|
||||
return $html_output;
|
||||
@ -1120,7 +1121,7 @@ class InsertEdit
|
||||
$html_output .= '<option value="' . $enum_value['html'] . '"';
|
||||
if ($data == $enum_value['plain']
|
||||
|| ($data == ''
|
||||
&& (! isset($_REQUEST['where_clause']) || $column['Null'] != 'YES')
|
||||
&& (! isset($_POST['where_clause']) || $column['Null'] != 'YES')
|
||||
&& isset($column['Default'])
|
||||
&& $enum_value['plain'] == $column['Default'])
|
||||
) {
|
||||
@ -1176,7 +1177,7 @@ class InsertEdit
|
||||
. ' ' . $onChangeClause;
|
||||
if ($data == $enum_value['plain']
|
||||
|| ($data == ''
|
||||
&& (! isset($_REQUEST['where_clause']) || $column['Null'] != 'YES')
|
||||
&& (! isset($_POST['where_clause']) || $column['Null'] != 'YES')
|
||||
&& isset($column['Default'])
|
||||
&& $enum_value['plain'] == $column['Default'])
|
||||
) {
|
||||
@ -1737,7 +1738,7 @@ class InsertEdit
|
||||
'err_url' => $err_url,
|
||||
'goto' => $GLOBALS['goto'],
|
||||
'sql_query' => isset($_POST['sql_query']) ? $_POST['sql_query'] : null,
|
||||
'has_where_clause' => isset($_REQUEST['where_clause']),
|
||||
'has_where_clause' => isset($_POST['where_clause']),
|
||||
'insert_rows_default' => $GLOBALS['cfg']['InsertRows'],
|
||||
]);
|
||||
}
|
||||
@ -2019,8 +2020,8 @@ class InsertEdit
|
||||
|
||||
//when copying row, it is useful to empty auto-increment column
|
||||
// to prevent duplicate key error
|
||||
if (isset($_REQUEST['default_action'])
|
||||
&& $_REQUEST['default_action'] === 'insert'
|
||||
if (isset($_POST['default_action'])
|
||||
&& $_POST['default_action'] === 'insert'
|
||||
) {
|
||||
if ($column['Key'] === 'PRI'
|
||||
&& mb_strpos($column['Extra'], 'auto_increment') !== false
|
||||
@ -2099,29 +2100,29 @@ class InsertEdit
|
||||
*/
|
||||
public function getParamsForUpdateOrInsert()
|
||||
{
|
||||
if (isset($_REQUEST['where_clause'])) {
|
||||
if (isset($_POST['where_clause'])) {
|
||||
// we were editing something => use the WHERE clause
|
||||
$loop_array = is_array($_REQUEST['where_clause'])
|
||||
? $_REQUEST['where_clause']
|
||||
: array($_REQUEST['where_clause']);
|
||||
$loop_array = is_array($_POST['where_clause'])
|
||||
? $_POST['where_clause']
|
||||
: array($_POST['where_clause']);
|
||||
$using_key = true;
|
||||
$is_insert = isset($_REQUEST['submit_type'])
|
||||
&& ($_REQUEST['submit_type'] == 'insert'
|
||||
|| $_REQUEST['submit_type'] == 'showinsert'
|
||||
|| $_REQUEST['submit_type'] == 'insertignore');
|
||||
$is_insert = isset($_POST['submit_type'])
|
||||
&& ($_POST['submit_type'] == 'insert'
|
||||
|| $_POST['submit_type'] == 'showinsert'
|
||||
|| $_POST['submit_type'] == 'insertignore');
|
||||
} else {
|
||||
// new row => use indexes
|
||||
$loop_array = array();
|
||||
if (! empty($_REQUEST['fields'])) {
|
||||
foreach ($_REQUEST['fields']['multi_edit'] as $key => $dummy) {
|
||||
if (! empty($_POST['fields'])) {
|
||||
foreach ($_POST['fields']['multi_edit'] as $key => $dummy) {
|
||||
$loop_array[] = $key;
|
||||
}
|
||||
}
|
||||
$using_key = false;
|
||||
$is_insert = true;
|
||||
}
|
||||
$is_insertignore = isset($_REQUEST['submit_type'])
|
||||
&& $_REQUEST['submit_type'] == 'insertignore';
|
||||
$is_insertignore = isset($_POST['submit_type'])
|
||||
&& $_POST['submit_type'] == 'insertignore';
|
||||
return array($loop_array, $using_key, $is_insert, $is_insertignore);
|
||||
}
|
||||
|
||||
@ -2133,11 +2134,11 @@ class InsertEdit
|
||||
*/
|
||||
public function isInsertRow()
|
||||
{
|
||||
if (isset($_REQUEST['insert_rows'])
|
||||
&& is_numeric($_REQUEST['insert_rows'])
|
||||
&& $_REQUEST['insert_rows'] != $GLOBALS['cfg']['InsertRows']
|
||||
if (isset($_POST['insert_rows'])
|
||||
&& is_numeric($_POST['insert_rows'])
|
||||
&& $_POST['insert_rows'] != $GLOBALS['cfg']['InsertRows']
|
||||
) {
|
||||
$GLOBALS['cfg']['InsertRows'] = $_REQUEST['insert_rows'];
|
||||
$GLOBALS['cfg']['InsertRows'] = $_POST['insert_rows'];
|
||||
$response = Response::getInstance();
|
||||
$header = $response->getHeader();
|
||||
$scripts = $header->getScripts();
|
||||
@ -2197,8 +2198,8 @@ class InsertEdit
|
||||
public function getGotoInclude($goto_include)
|
||||
{
|
||||
$valid_options = array('new_insert', 'same_insert', 'edit_next');
|
||||
if (isset($_REQUEST['after_insert'])
|
||||
&& in_array($_REQUEST['after_insert'], $valid_options)
|
||||
if (isset($_POST['after_insert'])
|
||||
&& in_array($_POST['after_insert'], $valid_options)
|
||||
) {
|
||||
$goto_include = 'tbl_change.php';
|
||||
} elseif (! empty($GLOBALS['goto'])) {
|
||||
@ -2232,8 +2233,8 @@ class InsertEdit
|
||||
*/
|
||||
public function getErrorUrl(array $url_params)
|
||||
{
|
||||
if (isset($_REQUEST['err_url'])) {
|
||||
return $_REQUEST['err_url'];
|
||||
if (isset($_POST['err_url'])) {
|
||||
return $_POST['err_url'];
|
||||
}
|
||||
|
||||
return 'tbl_change.php' . Url::getCommon($url_params);
|
||||
@ -2242,7 +2243,7 @@ class InsertEdit
|
||||
/**
|
||||
* Builds the sql query
|
||||
*
|
||||
* @param boolean $is_insertignore $_REQUEST['submit_type'] == 'insertignore'
|
||||
* @param boolean $is_insertignore $_POST['submit_type'] == 'insertignore'
|
||||
* @param array $query_fields column names array
|
||||
* @param array $value_sets array of query values
|
||||
*
|
||||
@ -2292,7 +2293,7 @@ class InsertEdit
|
||||
$error_messages = array();
|
||||
|
||||
foreach ($query as $single_query) {
|
||||
if ($_REQUEST['submit_type'] == 'showinsert') {
|
||||
if ($_POST['submit_type'] == 'showinsert') {
|
||||
$last_messages[] = Message::notice(__('Showing SQL query'));
|
||||
continue;
|
||||
}
|
||||
@ -2482,7 +2483,7 @@ class InsertEdit
|
||||
$_url_params = array(
|
||||
'db' => $db,
|
||||
'table' => $table,
|
||||
'where_clause' => $_REQUEST['where_clause'],
|
||||
'where_clause' => $_POST['where_clause'],
|
||||
'transform_key' => $column_name
|
||||
);
|
||||
$transform_options = Transformations::getOptions(
|
||||
@ -2719,10 +2720,10 @@ class InsertEdit
|
||||
$current_value = "''";
|
||||
}
|
||||
} elseif ($type == 'set') {
|
||||
if (! empty($_REQUEST['fields']['multi_edit'][$rownumber][$key])) {
|
||||
if (! empty($_POST['fields']['multi_edit'][$rownumber][$key])) {
|
||||
$current_value = implode(
|
||||
',',
|
||||
$_REQUEST['fields']['multi_edit'][$rownumber][$key]
|
||||
$_POST['fields']['multi_edit'][$rownumber][$key]
|
||||
);
|
||||
$current_value = "'"
|
||||
. $this->dbi->escapeString($current_value) . "'";
|
||||
@ -2803,7 +2804,7 @@ class InsertEdit
|
||||
. Util::backquote($column_name)
|
||||
. ' FROM ' . Util::backquote($db) . '.'
|
||||
. Util::backquote($table)
|
||||
. ' WHERE ' . $_REQUEST['where_clause'][0];
|
||||
. ' WHERE ' . $_POST['where_clause'][0];
|
||||
|
||||
$result = $this->dbi->tryQuery($sql_for_real_value);
|
||||
$fields_meta = $this->dbi->getFieldsMeta($result);
|
||||
@ -2849,23 +2850,23 @@ class InsertEdit
|
||||
*/
|
||||
public function determineInsertOrEdit($where_clause, $db, $table)
|
||||
{
|
||||
if (isset($_REQUEST['where_clause'])) {
|
||||
$where_clause = $_REQUEST['where_clause'];
|
||||
if (isset($_POST['where_clause'])) {
|
||||
$where_clause = $_POST['where_clause'];
|
||||
}
|
||||
if (isset($_SESSION['edit_next'])) {
|
||||
$where_clause = $_SESSION['edit_next'];
|
||||
unset($_SESSION['edit_next']);
|
||||
$after_insert = 'edit_next';
|
||||
}
|
||||
if (isset($_REQUEST['ShowFunctionFields'])) {
|
||||
$GLOBALS['cfg']['ShowFunctionFields'] = $_REQUEST['ShowFunctionFields'];
|
||||
if (isset($_POST['ShowFunctionFields'])) {
|
||||
$GLOBALS['cfg']['ShowFunctionFields'] = $_POST['ShowFunctionFields'];
|
||||
}
|
||||
if (isset($_REQUEST['ShowFieldTypesInDataEditView'])) {
|
||||
if (isset($_POST['ShowFieldTypesInDataEditView'])) {
|
||||
$GLOBALS['cfg']['ShowFieldTypesInDataEditView']
|
||||
= $_REQUEST['ShowFieldTypesInDataEditView'];
|
||||
= $_POST['ShowFieldTypesInDataEditView'];
|
||||
}
|
||||
if (isset($_REQUEST['after_insert'])) {
|
||||
$after_insert = $_REQUEST['after_insert'];
|
||||
if (isset($_POST['after_insert'])) {
|
||||
$after_insert = $_POST['after_insert'];
|
||||
}
|
||||
|
||||
if (isset($where_clause)) {
|
||||
@ -2890,8 +2891,8 @@ class InsertEdit
|
||||
|
||||
// Copying a row - fetched data will be inserted as a new row,
|
||||
// therefore the where clause is needless.
|
||||
if (isset($_REQUEST['default_action'])
|
||||
&& $_REQUEST['default_action'] === 'insert'
|
||||
if (isset($_POST['default_action'])
|
||||
&& $_POST['default_action'] === 'insert'
|
||||
) {
|
||||
$where_clause = $where_clauses = null;
|
||||
}
|
||||
|
||||
@ -51,8 +51,8 @@ class Navigation
|
||||
}
|
||||
$tree = new NavigationTree();
|
||||
if (! $response->isAjax()
|
||||
|| ! empty($_REQUEST['full'])
|
||||
|| ! empty($_REQUEST['reload'])
|
||||
|| ! empty($_POST['full'])
|
||||
|| ! empty($_POST['reload'])
|
||||
) {
|
||||
if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) {
|
||||
// provide database tree in navigation
|
||||
@ -230,8 +230,8 @@ class Navigation
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= '<td>' . htmlspecialchars($hiddenItem) . '</td>';
|
||||
$html .= '<td style="width:80px"><a href="navigation.php'
|
||||
. Url::getCommon($params) . '"'
|
||||
$html .= '<td style="width:80px"><a href="navigation.php" data-post="'
|
||||
. Url::getCommon($params, '') . '"'
|
||||
. ' class="unhideNavItem ajax">'
|
||||
. Util::getIcon('show', __('Show'))
|
||||
. '</a></td>';
|
||||
|
||||
@ -93,8 +93,10 @@ class NavigationTree
|
||||
public function __construct()
|
||||
{
|
||||
// Save the position at which we are in the database list
|
||||
if (isset($_REQUEST['pos'])) {
|
||||
$this->_pos = (int)$_REQUEST['pos'];
|
||||
if (isset($_POST['pos'])) {
|
||||
$this->_pos = (int) $_POST['pos'];
|
||||
} elseif (isset($_GET['pos'])) {
|
||||
$this->_pos = (int) $_GET['pos'];
|
||||
}
|
||||
if (!isset($this->_pos)) {
|
||||
$this->_pos = $this->_getNavigationDbPos();
|
||||
@ -109,19 +111,19 @@ class NavigationTree
|
||||
$this->_pos3_value[0] = $_REQUEST['pos3_value'];
|
||||
}
|
||||
} else {
|
||||
if (isset($_REQUEST['n0_aPath'])) {
|
||||
if (isset($_POST['n0_aPath'])) {
|
||||
$count = 0;
|
||||
while (isset($_REQUEST['n' . $count . '_aPath'])) {
|
||||
while (isset($_POST['n' . $count . '_aPath'])) {
|
||||
$this->_aPath[$count] = $this->_parsePath(
|
||||
$_REQUEST['n' . $count . '_aPath']
|
||||
$_POST['n' . $count . '_aPath']
|
||||
);
|
||||
$index = 'n' . $count . '_pos2_';
|
||||
$this->_pos2_name[$count] = $_REQUEST[$index . 'name'];
|
||||
$this->_pos2_value[$count] = $_REQUEST[$index . 'value'];
|
||||
$this->_pos2_name[$count] = $_POST[$index . 'name'];
|
||||
$this->_pos2_value[$count] = $_POST[$index . 'value'];
|
||||
$index = 'n' . $count . '_pos3_';
|
||||
if (isset($_REQUEST[$index])) {
|
||||
$this->_pos3_name[$count] = $_REQUEST[$index . 'name'];
|
||||
$this->_pos3_value[$count] = $_REQUEST[$index . 'value'];
|
||||
if (isset($_POST[$index])) {
|
||||
$this->_pos3_name[$count] = $_POST[$index . 'name'];
|
||||
$this->_pos3_value[$count] = $_POST[$index . 'value'];
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
@ -130,11 +132,11 @@ class NavigationTree
|
||||
if (isset($_REQUEST['vPath'])) {
|
||||
$this->_vPath[0] = $this->_parsePath($_REQUEST['vPath']);
|
||||
} else {
|
||||
if (isset($_REQUEST['n0_vPath'])) {
|
||||
if (isset($_POST['n0_vPath'])) {
|
||||
$count = 0;
|
||||
while (isset($_REQUEST['n' . $count . '_vPath'])) {
|
||||
while (isset($_POST['n' . $count . '_vPath'])) {
|
||||
$this->_vPath[$count] = $this->_parsePath(
|
||||
$_REQUEST['n' . $count . '_vPath']
|
||||
$_POST['n' . $count . '_vPath']
|
||||
);
|
||||
$count++;
|
||||
}
|
||||
|
||||
@ -677,8 +677,8 @@ class NodeDatabase extends Node
|
||||
'dbName' => $this->real_name,
|
||||
);
|
||||
$ret = '<span class="dbItemControls">'
|
||||
. '<a href="navigation.php'
|
||||
. Url::getCommon($params) . '"'
|
||||
. '<a href="navigation.php" data-post="'
|
||||
. Url::getCommon($params, '') . '"'
|
||||
. ' class="showUnhide ajax">'
|
||||
. Util::getImage(
|
||||
'show',
|
||||
|
||||
@ -48,8 +48,8 @@ abstract class NodeDatabaseChild extends Node
|
||||
);
|
||||
|
||||
$ret = '<span class="navItemControls">'
|
||||
. '<a href="navigation.php'
|
||||
. Url::getCommon($params) . '"'
|
||||
. '<a href="navigation.php" data-post="'
|
||||
. Url::getCommon($params, '') . '"'
|
||||
. ' class="hideNavItem ajax">'
|
||||
. Util::getImage('hide', __('Hide'))
|
||||
. '</a></span>';
|
||||
|
||||
@ -152,7 +152,7 @@ class Normalization
|
||||
'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(),
|
||||
|
||||
@ -75,20 +75,21 @@ class Operations
|
||||
/**
|
||||
* Get HTML output for rename database
|
||||
*
|
||||
* @param string $db database name
|
||||
* @param string $db database name
|
||||
* @param string $db_collation dataset collation
|
||||
*
|
||||
* @return string $html_output
|
||||
*/
|
||||
public function getHtmlForRenameDatabase($db)
|
||||
public function getHtmlForRenameDatabase($db, $db_collation)
|
||||
{
|
||||
$html_output = '<div>'
|
||||
. '<form id="rename_db_form" '
|
||||
. 'class="ajax" '
|
||||
. 'method="post" action="db_operations.php" '
|
||||
. 'onsubmit="return emptyCheckTheField(this, \'newname\')">';
|
||||
if (isset($_REQUEST['db_collation'])) {
|
||||
if (isset($db_collation)) {
|
||||
$html_output .= '<input type="hidden" name="db_collation" '
|
||||
. 'value="' . $_REQUEST['db_collation']
|
||||
. 'value="' . $db_collation
|
||||
. '" />' . "\n";
|
||||
}
|
||||
$html_output .= '<input type="hidden" name="what" value="data" />'
|
||||
@ -184,11 +185,12 @@ class Operations
|
||||
/**
|
||||
* Get HTML snippet for copy database
|
||||
*
|
||||
* @param string $db database name
|
||||
* @param string $db database name
|
||||
* @param string $db_collation dataset collation
|
||||
*
|
||||
* @return string $html_output
|
||||
*/
|
||||
public function getHtmlForCopyDatabase($db)
|
||||
public function getHtmlForCopyDatabase($db, $db_collation)
|
||||
{
|
||||
$drop_clause = 'DROP TABLE / DROP VIEW';
|
||||
$choices = array(
|
||||
@ -205,9 +207,9 @@ class Operations
|
||||
. 'method="post" action="db_operations.php" '
|
||||
. 'onsubmit="return emptyCheckTheField(this, \'newname\')">';
|
||||
|
||||
if (isset($_REQUEST['db_collation'])) {
|
||||
if (isset($db_collation)) {
|
||||
$html_output .= '<input type="hidden" name="db_collation" '
|
||||
. 'value="' . $_REQUEST['db_collation'] . '" />' . "\n";
|
||||
. 'value="' . $db_collation . '" />' . "\n";
|
||||
}
|
||||
$html_output .= '<input type="hidden" name="db_copy" value="true" />' . "\n"
|
||||
. Url::getHiddenInputs($db);
|
||||
@ -281,19 +283,19 @@ class Operations
|
||||
/**
|
||||
* Get HTML snippet for change database charset
|
||||
*
|
||||
* @param string $db database name
|
||||
* @param string $table table name
|
||||
* @param string $db database name
|
||||
* @param string $db_collation dataset collation
|
||||
*
|
||||
* @return string $html_output
|
||||
*/
|
||||
public function getHtmlForChangeDatabaseCharset($db, $table)
|
||||
public function getHtmlForChangeDatabaseCharset($db, $db_collation)
|
||||
{
|
||||
$html_output = '<div>'
|
||||
. '<form id="change_db_charset_form" ';
|
||||
$html_output .= 'class="ajax" ';
|
||||
$html_output .= 'method="post" action="db_operations.php">';
|
||||
|
||||
$html_output .= Url::getHiddenInputs($db, $table);
|
||||
$html_output .= Url::getHiddenInputs($db);
|
||||
|
||||
$html_output .= '<fieldset>' . "\n"
|
||||
. ' <legend>';
|
||||
@ -308,7 +310,7 @@ class Operations
|
||||
$GLOBALS['cfg']['Server']['DisableIS'],
|
||||
'db_collation',
|
||||
'select_db_collation',
|
||||
isset($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : '',
|
||||
isset($db_collation) ? $db_collation : '',
|
||||
false
|
||||
)
|
||||
. '<br />'
|
||||
@ -356,7 +358,7 @@ class Operations
|
||||
if ($tmp_query !== false) {
|
||||
// collect for later display
|
||||
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
$GLOBALS['dbi']->query($tmp_query);
|
||||
}
|
||||
}
|
||||
@ -372,7 +374,7 @@ class Operations
|
||||
if ($tmp_query !== false) {
|
||||
// collect for later display
|
||||
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
$GLOBALS['dbi']->query($tmp_query);
|
||||
}
|
||||
}
|
||||
@ -387,10 +389,10 @@ class Operations
|
||||
public function createDbBeforeCopy()
|
||||
{
|
||||
$local_query = 'CREATE DATABASE IF NOT EXISTS '
|
||||
. Util::backquote($_REQUEST['newname']);
|
||||
if (isset($_REQUEST['db_collation'])) {
|
||||
. Util::backquote($_POST['newname']);
|
||||
if (isset($_POST['db_collation'])) {
|
||||
$local_query .= ' DEFAULT'
|
||||
. Util::getCharsetQueryPart($_REQUEST['db_collation']);
|
||||
. Util::getCharsetQueryPart($_POST['db_collation']);
|
||||
}
|
||||
$local_query .= ';';
|
||||
$GLOBALS['sql_query'] .= $local_query;
|
||||
@ -432,12 +434,12 @@ class Operations
|
||||
if ($GLOBALS['dbi']->getTable($db, $each_table)->isView()) {
|
||||
|
||||
// If view exists, and 'add drop view' is selected: Drop it!
|
||||
if ($_REQUEST['what'] != 'nocopy'
|
||||
&& isset($_REQUEST['drop_if_exists'])
|
||||
&& $_REQUEST['drop_if_exists'] == 'true'
|
||||
if ($_POST['what'] != 'nocopy'
|
||||
&& isset($_POST['drop_if_exists'])
|
||||
&& $_POST['drop_if_exists'] == 'true'
|
||||
) {
|
||||
$drop_query = 'DROP VIEW IF EXISTS '
|
||||
. Util::backquote($_REQUEST['newname']) . '.'
|
||||
. Util::backquote($_POST['newname']) . '.'
|
||||
. Util::backquote($each_table);
|
||||
$GLOBALS['dbi']->query($drop_query);
|
||||
|
||||
@ -449,7 +451,7 @@ class Operations
|
||||
$sql_view_standin = $export_sql_plugin->getTableDefStandIn(
|
||||
$db, $each_table, "\n"
|
||||
);
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
$GLOBALS['dbi']->query($sql_view_standin);
|
||||
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin;
|
||||
}
|
||||
@ -476,7 +478,7 @@ class Operations
|
||||
}
|
||||
|
||||
// value of $what for this table only
|
||||
$this_what = $_REQUEST['what'];
|
||||
$this_what = $_POST['what'];
|
||||
|
||||
// do not copy the data from a Merge table
|
||||
// note: on the calling FORM, 'data' means 'structure and data'
|
||||
@ -496,7 +498,7 @@ class Operations
|
||||
$triggers = $GLOBALS['dbi']->getTriggers($db, $each_table, '');
|
||||
|
||||
if (! Table::moveCopy(
|
||||
$db, $each_table, $_REQUEST['newname'], $each_table,
|
||||
$db, $each_table, $_POST['newname'], $each_table,
|
||||
(isset($this_what) ? $this_what : 'data'),
|
||||
$move, 'db_copy'
|
||||
)) {
|
||||
@ -505,7 +507,7 @@ class Operations
|
||||
}
|
||||
// apply the triggers to the destination db+table
|
||||
if ($triggers) {
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
foreach ($triggers as $trigger) {
|
||||
$GLOBALS['dbi']->query($trigger['create']);
|
||||
$GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';';
|
||||
@ -513,7 +515,7 @@ class Operations
|
||||
}
|
||||
|
||||
// this does not apply to a rename operation
|
||||
if (isset($_REQUEST['add_constraints'])
|
||||
if (isset($_POST['add_constraints'])
|
||||
&& ! empty($GLOBALS['sql_constraints_query'])
|
||||
) {
|
||||
$sqlContraints[] = $GLOBALS['sql_constraints_query'];
|
||||
@ -547,7 +549,7 @@ class Operations
|
||||
$tmp_query = $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name);
|
||||
// collect for later display
|
||||
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
$GLOBALS['dbi']->query($tmp_query);
|
||||
}
|
||||
}
|
||||
@ -566,26 +568,26 @@ class Operations
|
||||
{
|
||||
// temporarily force to add DROP IF EXIST to CREATE VIEW query,
|
||||
// to remove stand-in VIEW that was created earlier
|
||||
// ( $_REQUEST['drop_if_exists'] is used in moveCopy() )
|
||||
if (isset($_REQUEST['drop_if_exists'])) {
|
||||
$temp_drop_if_exists = $_REQUEST['drop_if_exists'];
|
||||
// ( $_POST['drop_if_exists'] is used in moveCopy() )
|
||||
if (isset($_POST['drop_if_exists'])) {
|
||||
$temp_drop_if_exists = $_POST['drop_if_exists'];
|
||||
}
|
||||
|
||||
$_REQUEST['drop_if_exists'] = 'true';
|
||||
$_POST['drop_if_exists'] = 'true';
|
||||
foreach ($views as $view) {
|
||||
$copying_succeeded = Table::moveCopy(
|
||||
$db, $view, $_REQUEST['newname'], $view, 'structure', $move, 'db_copy'
|
||||
$db, $view, $_POST['newname'], $view, 'structure', $move, 'db_copy'
|
||||
);
|
||||
if (! $copying_succeeded) {
|
||||
$GLOBALS['_error'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset($_REQUEST['drop_if_exists']);
|
||||
unset($_POST['drop_if_exists']);
|
||||
|
||||
if (isset($temp_drop_if_exists)) {
|
||||
// restore previous value
|
||||
$_REQUEST['drop_if_exists'] = $temp_drop_if_exists;
|
||||
$_POST['drop_if_exists'] = $temp_drop_if_exists;
|
||||
}
|
||||
}
|
||||
|
||||
@ -753,7 +755,7 @@ class Operations
|
||||
*/
|
||||
public function createAllAccumulatedConstraints(array $sqlConstratints)
|
||||
{
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['newname']);
|
||||
$GLOBALS['dbi']->selectDb($_POST['newname']);
|
||||
foreach ($sqlConstratints as $one_query) {
|
||||
$GLOBALS['dbi']->query($one_query);
|
||||
// and prepare to display them
|
||||
@ -771,10 +773,10 @@ class Operations
|
||||
*/
|
||||
public function duplicateBookmarks($_error, $db)
|
||||
{
|
||||
if (! $_error && $db != $_REQUEST['newname']) {
|
||||
if (! $_error && $db != $_POST['newname']) {
|
||||
$get_fields = array('user', 'label', 'query');
|
||||
$where_fields = array('dbase' => $db);
|
||||
$new_fields = array('dbase' => $_REQUEST['newname']);
|
||||
$new_fields = array('dbase' => $_POST['newname']);
|
||||
Table::duplicateInfo(
|
||||
'bookmarkwork', 'bookmark', $get_fields,
|
||||
$where_fields, $new_fields
|
||||
@ -1735,9 +1737,9 @@ class Operations
|
||||
$sql_query = 'ALTER TABLE '
|
||||
. Util::backquote($GLOBALS['table'])
|
||||
. ' ORDER BY '
|
||||
. Util::backquote(urldecode($_REQUEST['order_field']));
|
||||
if (isset($_REQUEST['order_order'])
|
||||
&& $_REQUEST['order_order'] === 'desc'
|
||||
. Util::backquote(urldecode($_POST['order_field']));
|
||||
if (isset($_POST['order_order'])
|
||||
&& $_POST['order_order'] === 'desc'
|
||||
) {
|
||||
$sql_query .= ' DESC';
|
||||
} else {
|
||||
@ -1772,11 +1774,11 @@ class Operations
|
||||
|
||||
$table_alters = array();
|
||||
|
||||
if (isset($_REQUEST['comment'])
|
||||
&& urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']
|
||||
if (isset($_POST['comment'])
|
||||
&& urldecode($_POST['prev_comment']) !== $_POST['comment']
|
||||
) {
|
||||
$table_alters[] = 'COMMENT = \''
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['comment']) . '\'';
|
||||
. $GLOBALS['dbi']->escapeString($_POST['comment']) . '\'';
|
||||
}
|
||||
|
||||
if (! empty($newTblStorageEngine)
|
||||
@ -1784,62 +1786,62 @@ class Operations
|
||||
) {
|
||||
$table_alters[] = 'ENGINE = ' . $newTblStorageEngine;
|
||||
}
|
||||
if (! empty($_REQUEST['tbl_collation'])
|
||||
&& $_REQUEST['tbl_collation'] !== $tbl_collation
|
||||
if (! empty($_POST['tbl_collation'])
|
||||
&& $_POST['tbl_collation'] !== $tbl_collation
|
||||
) {
|
||||
$table_alters[] = 'DEFAULT '
|
||||
. Util::getCharsetQueryPart($_REQUEST['tbl_collation']);
|
||||
. Util::getCharsetQueryPart($_POST['tbl_collation']);
|
||||
}
|
||||
|
||||
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'ISAM'))
|
||||
&& isset($_REQUEST['new_pack_keys'])
|
||||
&& $_REQUEST['new_pack_keys'] != (string)$pack_keys
|
||||
&& isset($_POST['new_pack_keys'])
|
||||
&& $_POST['new_pack_keys'] != (string)$pack_keys
|
||||
) {
|
||||
$table_alters[] = 'pack_keys = ' . $_REQUEST['new_pack_keys'];
|
||||
$table_alters[] = 'pack_keys = ' . $_POST['new_pack_keys'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_checksum'] = empty($_REQUEST['new_checksum']) ? '0' : '1';
|
||||
$_POST['new_checksum'] = empty($_POST['new_checksum']) ? '0' : '1';
|
||||
if ($pma_table->isEngine(array('MYISAM', 'ARIA'))
|
||||
&& $_REQUEST['new_checksum'] !== $checksum
|
||||
&& $_POST['new_checksum'] !== $checksum
|
||||
) {
|
||||
$table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
|
||||
$table_alters[] = 'checksum = ' . $_POST['new_checksum'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_transactional']
|
||||
= empty($_REQUEST['new_transactional']) ? '0' : '1';
|
||||
$_POST['new_transactional']
|
||||
= empty($_POST['new_transactional']) ? '0' : '1';
|
||||
if ($pma_table->isEngine('ARIA')
|
||||
&& $_REQUEST['new_transactional'] !== $transactional
|
||||
&& $_POST['new_transactional'] !== $transactional
|
||||
) {
|
||||
$table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional'];
|
||||
$table_alters[] = 'TRANSACTIONAL = ' . $_POST['new_transactional'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_page_checksum']
|
||||
= empty($_REQUEST['new_page_checksum']) ? '0' : '1';
|
||||
$_POST['new_page_checksum']
|
||||
= empty($_POST['new_page_checksum']) ? '0' : '1';
|
||||
if ($pma_table->isEngine('ARIA')
|
||||
&& $_REQUEST['new_page_checksum'] !== $page_checksum
|
||||
&& $_POST['new_page_checksum'] !== $page_checksum
|
||||
) {
|
||||
$table_alters[] = 'PAGE_CHECKSUM = ' . $_REQUEST['new_page_checksum'];
|
||||
$table_alters[] = 'PAGE_CHECKSUM = ' . $_POST['new_page_checksum'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_delay_key_write']
|
||||
= empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
|
||||
$_POST['new_delay_key_write']
|
||||
= empty($_POST['new_delay_key_write']) ? '0' : '1';
|
||||
if ($pma_table->isEngine(array('MYISAM', 'ARIA'))
|
||||
&& $_REQUEST['new_delay_key_write'] !== $delay_key_write
|
||||
&& $_POST['new_delay_key_write'] !== $delay_key_write
|
||||
) {
|
||||
$table_alters[] = 'delay_key_write = ' . $_REQUEST['new_delay_key_write'];
|
||||
$table_alters[] = 'delay_key_write = ' . $_POST['new_delay_key_write'];
|
||||
}
|
||||
|
||||
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT'))
|
||||
&& ! empty($_REQUEST['new_auto_increment'])
|
||||
&& ! empty($_POST['new_auto_increment'])
|
||||
&& (! isset($auto_increment)
|
||||
|| $_REQUEST['new_auto_increment'] !== $auto_increment)
|
||||
|| $_POST['new_auto_increment'] !== $auto_increment)
|
||||
) {
|
||||
$table_alters[] = 'auto_increment = '
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['new_auto_increment']);
|
||||
. $GLOBALS['dbi']->escapeString($_POST['new_auto_increment']);
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['new_row_format'])) {
|
||||
$newRowFormat = $_REQUEST['new_row_format'];
|
||||
if (! empty($_POST['new_row_format'])) {
|
||||
$newRowFormat = $_POST['new_row_format'];
|
||||
$newRowFormatLower = mb_strtolower($newRowFormat);
|
||||
if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT'))
|
||||
&& (strlen($row_format) === 0
|
||||
@ -1868,8 +1870,8 @@ class Operations
|
||||
// should not be reported with a Level of Error, so here
|
||||
// I just ignore it. But there are other 1478 messages
|
||||
// that it's better to show.
|
||||
if (! (isset($_REQUEST['new_tbl_storage_engine'])
|
||||
&& $_REQUEST['new_tbl_storage_engine'] == 'MyISAM'
|
||||
if (! (isset($_POST['new_tbl_storage_engine'])
|
||||
&& $_POST['new_tbl_storage_engine'] == 'MyISAM'
|
||||
&& $warning['Code'] == '1478'
|
||||
&& $warning['Level'] == 'Error')
|
||||
) {
|
||||
@ -1890,13 +1892,13 @@ class Operations
|
||||
{
|
||||
$sql_query = 'ALTER TABLE '
|
||||
. Util::backquote($GLOBALS['table']) . ' '
|
||||
. $_REQUEST['partition_operation']
|
||||
. $_POST['partition_operation']
|
||||
. ' PARTITION ';
|
||||
|
||||
if ($_REQUEST['partition_operation'] == 'COALESCE') {
|
||||
$sql_query .= count($_REQUEST['partition_name']);
|
||||
if ($_POST['partition_operation'] == 'COALESCE') {
|
||||
$sql_query .= count($_POST['partition_name']);
|
||||
} else {
|
||||
$sql_query .= implode(', ', $_REQUEST['partition_name']) . ';';
|
||||
$sql_query .= implode(', ', $_POST['partition_name']) . ';';
|
||||
}
|
||||
|
||||
$result = $GLOBALS['dbi']->query($sql_query);
|
||||
@ -2045,43 +2047,43 @@ class Operations
|
||||
$GLOBALS['dbi']->selectDb($db);
|
||||
|
||||
/**
|
||||
* $_REQUEST['target_db'] could be empty in case we came from an input field
|
||||
* $_POST['target_db'] could be empty in case we came from an input field
|
||||
* (when there are many databases, no drop-down)
|
||||
*/
|
||||
if (empty($_REQUEST['target_db'])) {
|
||||
$_REQUEST['target_db'] = $db;
|
||||
if (empty($_POST['target_db'])) {
|
||||
$_POST['target_db'] = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* A target table name has been sent to this script -> do the work
|
||||
*/
|
||||
if (Core::isValid($_REQUEST['new_name'])) {
|
||||
if ($db == $_REQUEST['target_db'] && $table == $_REQUEST['new_name']) {
|
||||
if (isset($_REQUEST['submit_move'])) {
|
||||
if (Core::isValid($_POST['new_name'])) {
|
||||
if ($db == $_POST['target_db'] && $table == $_POST['new_name']) {
|
||||
if (isset($_POST['submit_move'])) {
|
||||
$message = Message::error(__('Can\'t move table to same one!'));
|
||||
} else {
|
||||
$message = Message::error(__('Can\'t copy table to same one!'));
|
||||
}
|
||||
} else {
|
||||
Table::moveCopy(
|
||||
$db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'],
|
||||
$_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table'
|
||||
$db, $table, $_POST['target_db'], $_POST['new_name'],
|
||||
$_POST['what'], isset($_POST['submit_move']), 'one_table'
|
||||
);
|
||||
|
||||
if (isset($_REQUEST['adjust_privileges'])
|
||||
&& ! empty($_REQUEST['adjust_privileges'])
|
||||
if (isset($_POST['adjust_privileges'])
|
||||
&& ! empty($_POST['adjust_privileges'])
|
||||
) {
|
||||
if (isset($_REQUEST['submit_move'])) {
|
||||
if (isset($_POST['submit_move'])) {
|
||||
$this->adjustPrivilegesRenameOrMoveTable(
|
||||
$db, $table, $_REQUEST['target_db'], $_REQUEST['new_name']
|
||||
$db, $table, $_POST['target_db'], $_POST['new_name']
|
||||
);
|
||||
} else {
|
||||
$this->adjustPrivilegesCopyTable(
|
||||
$db, $table, $_REQUEST['target_db'], $_REQUEST['new_name']
|
||||
$db, $table, $_POST['target_db'], $_POST['new_name']
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['submit_move'])) {
|
||||
if (isset($_POST['submit_move'])) {
|
||||
$message = Message::success(
|
||||
__(
|
||||
'Table %s has been moved to %s. Privileges have been '
|
||||
@ -2098,7 +2100,7 @@ class Operations
|
||||
}
|
||||
|
||||
} else {
|
||||
if (isset($_REQUEST['submit_move'])) {
|
||||
if (isset($_POST['submit_move'])) {
|
||||
$message = Message::success(
|
||||
__('Table %s has been moved to %s.')
|
||||
);
|
||||
@ -2113,20 +2115,20 @@ class Operations
|
||||
. Util::backquote($table);
|
||||
$message->addParam($old);
|
||||
|
||||
$new_name = $_REQUEST['new_name'];
|
||||
$new_name = $_POST['new_name'];
|
||||
if ($GLOBALS['dbi']->getLowerCaseNames() === '1') {
|
||||
$new_name = strtolower($new_name);
|
||||
}
|
||||
|
||||
$GLOBALS['table'] = $new_name;
|
||||
|
||||
$new = Util::backquote($_REQUEST['target_db']) . '.'
|
||||
$new = Util::backquote($_POST['target_db']) . '.'
|
||||
. Util::backquote($new_name);
|
||||
$message->addParam($new);
|
||||
|
||||
/* Check: Work on new table or on old table? */
|
||||
if (isset($_REQUEST['submit_move'])
|
||||
|| Core::isValid($_REQUEST['switch_to_new'])
|
||||
if (isset($_POST['submit_move'])
|
||||
|| Core::isValid($_POST['switch_to_new'])
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -1994,7 +1994,7 @@ class Relation
|
||||
{
|
||||
$retval = '';
|
||||
|
||||
$url_query = Url::getCommon(array('db' => $GLOBALS['db']));
|
||||
$url_query = Url::getCommon(array('db' => $GLOBALS['db']), '');
|
||||
if ($allTables) {
|
||||
if ($createDb) {
|
||||
$url_query .= '&goto=db_operations.php&create_pmadb=1';
|
||||
@ -2019,7 +2019,7 @@ class Relation
|
||||
__('%sCreate%s missing phpMyAdmin configuration storage tables.')
|
||||
);
|
||||
}
|
||||
$message->addParamHtml('<a href="./chk_rel.php' . $url_query . '">');
|
||||
$message->addParamHtml('<a href="./chk_rel.php" data-post="' . $url_query . '">');
|
||||
$message->addParamHtml('</a>');
|
||||
|
||||
$retval .= $message->getDisplay();
|
||||
|
||||
@ -53,7 +53,7 @@ class ReplicationGui
|
||||
public static function getHtmlForMasterReplication()
|
||||
{
|
||||
$html = '';
|
||||
if (! isset($_REQUEST['repl_clear_scr'])) {
|
||||
if (! isset($_POST['repl_clear_scr'])) {
|
||||
$html .= '<fieldset>';
|
||||
$html .= '<legend>' . __('Master replication') . '</legend>';
|
||||
$html .= __('This server is configured as master in a replication process.');
|
||||
@ -72,16 +72,16 @@ class ReplicationGui
|
||||
$_url_params['mr_adduser'] = true;
|
||||
$_url_params['repl_clear_scr'] = true;
|
||||
|
||||
$html .= ' <li><a href="server_replication.php';
|
||||
$html .= Url::getCommon($_url_params)
|
||||
$html .= ' <li><a href="server_replication.php" data-post="';
|
||||
$html .= Url::getCommon($_url_params, '')
|
||||
. '" id="master_addslaveuser_href">';
|
||||
$html .= __('Add slave replication user') . '</a></li>';
|
||||
}
|
||||
|
||||
// Display 'Add replication slave user' form
|
||||
if (isset($_REQUEST['mr_adduser'])) {
|
||||
if (isset($_POST['mr_adduser'])) {
|
||||
$html .= self::getHtmlForReplicationMasterAddSlaveUser();
|
||||
} elseif (! isset($_REQUEST['repl_clear_scr'])) {
|
||||
} elseif (! isset($_POST['repl_clear_scr'])) {
|
||||
$html .= "</ul>";
|
||||
$html .= "</fieldset>";
|
||||
}
|
||||
@ -164,8 +164,8 @@ class ReplicationGui
|
||||
$html .= ' <select name="master_connection">';
|
||||
$html .= '<option value="">' . __('Default') . '</option>';
|
||||
foreach ($server_slave_multi_replication as $server) {
|
||||
$html .= '<option' . (isset($_REQUEST['master_connection'])
|
||||
&& $_REQUEST['master_connection'] == $server['Connection_name'] ?
|
||||
$html .= '<option' . (isset($_POST['master_connection'])
|
||||
&& $_POST['master_connection'] == $server['Connection_name'] ?
|
||||
' selected="selected"' : '') . '>' . $server['Connection_name']
|
||||
. '</option>';
|
||||
}
|
||||
@ -188,8 +188,7 @@ class ReplicationGui
|
||||
}
|
||||
|
||||
$_url_params['sr_slave_control_parm'] = 'IO_THREAD';
|
||||
$slave_control_io_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$slave_control_io_link = Url::getCommon($_url_params, '');
|
||||
|
||||
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
|
||||
$_url_params['sr_slave_action'] = 'start';
|
||||
@ -198,8 +197,7 @@ class ReplicationGui
|
||||
}
|
||||
|
||||
$_url_params['sr_slave_control_parm'] = 'SQL_THREAD';
|
||||
$slave_control_sql_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$slave_control_sql_link = Url::getCommon($_url_params, '');
|
||||
|
||||
if ($server_slave_replication[0]['Slave_IO_Running'] == 'No'
|
||||
|| $server_slave_replication[0]['Slave_SQL_Running'] == 'No'
|
||||
@ -210,18 +208,15 @@ class ReplicationGui
|
||||
}
|
||||
|
||||
$_url_params['sr_slave_control_parm'] = null;
|
||||
$slave_control_full_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$slave_control_full_link = Url::getCommon($_url_params, '');
|
||||
|
||||
$_url_params['sr_slave_action'] = 'reset';
|
||||
$slave_control_reset_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$slave_control_reset_link = Url::getCommon($_url_params, '');
|
||||
|
||||
$_url_params = $GLOBALS['url_params'];
|
||||
$_url_params['sr_take_action'] = true;
|
||||
$_url_params['sr_slave_skip_error'] = true;
|
||||
$slave_skip_error_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$slave_skip_error_link = Url::getCommon($_url_params, '');
|
||||
|
||||
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
|
||||
$html .= Message::error(
|
||||
@ -238,8 +233,7 @@ class ReplicationGui
|
||||
$_url_params['sl_configure'] = true;
|
||||
$_url_params['repl_clear_scr'] = true;
|
||||
|
||||
$reconfiguremaster_link = 'server_replication.php'
|
||||
. Url::getCommon($_url_params);
|
||||
$reconfiguremaster_link = Url::getCommon($_url_params, '');
|
||||
|
||||
$html .= __(
|
||||
'Server is configured as slave in a replication process. Would you ' .
|
||||
@ -256,26 +250,26 @@ class ReplicationGui
|
||||
$html .= __('Control slave:') . '</a>';
|
||||
$html .= ' <div id="slave_control_gui" class="hide">';
|
||||
$html .= ' <ul>';
|
||||
$html .= ' <li><a href="' . $slave_control_full_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_full_link . '">';
|
||||
$html .= (($server_slave_replication[0]['Slave_IO_Running'] == 'No' ||
|
||||
$server_slave_replication[0]['Slave_SQL_Running'] == 'No')
|
||||
? __('Full start')
|
||||
: __('Full stop')) . ' </a></li>';
|
||||
$html .= ' <li><a class="ajax" id="reset_slave"'
|
||||
. ' href="' . $slave_control_reset_link . '">';
|
||||
. ' href="server_replication.php" data-post="' . $slave_control_reset_link . '">';
|
||||
$html .= __('Reset slave') . '</a></li>';
|
||||
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
|
||||
$html .= ' <li><a href="' . $slave_control_sql_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_sql_link . '">';
|
||||
$html .= __('Start SQL Thread only') . '</a></li>';
|
||||
} else {
|
||||
$html .= ' <li><a href="' . $slave_control_sql_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_sql_link . '">';
|
||||
$html .= __('Stop SQL Thread only') . '</a></li>';
|
||||
}
|
||||
if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
|
||||
$html .= ' <li><a href="' . $slave_control_io_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_io_link . '">';
|
||||
$html .= __('Start IO Thread only') . '</a></li>';
|
||||
} else {
|
||||
$html .= ' <li><a href="' . $slave_control_io_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_io_link . '">';
|
||||
$html .= __('Stop IO Thread only') . '</a></li>';
|
||||
}
|
||||
$html .= ' </ul>';
|
||||
@ -284,12 +278,12 @@ class ReplicationGui
|
||||
$html .= ' <li>';
|
||||
$html .= self::getHtmlForSlaveErrorManagement($slave_skip_error_link);
|
||||
$html .= ' </li>';
|
||||
$html .= ' <li><a href="' . $reconfiguremaster_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $reconfiguremaster_link . '">';
|
||||
$html .= __('Change or reconfigure master server') . '</a></li>';
|
||||
$html .= '</ul>';
|
||||
$html .= '</div>';
|
||||
|
||||
} elseif (! isset($_REQUEST['sl_configure'])) {
|
||||
} elseif (! isset($_POST['sl_configure'])) {
|
||||
$_url_params = $GLOBALS['url_params'];
|
||||
$_url_params['sl_configure'] = true;
|
||||
$_url_params['repl_clear_scr'] = true;
|
||||
@ -297,9 +291,10 @@ class ReplicationGui
|
||||
$html .= sprintf(
|
||||
__(
|
||||
'This server is not configured as slave in a replication process. '
|
||||
. 'Would you like to <a href="%s">configure</a> it?'
|
||||
. 'Would you like to %sconfigure%s it?'
|
||||
),
|
||||
'server_replication.php' . Url::getCommon($_url_params)
|
||||
'<a href="server_replication.php" data-post="' . Url::getCommon($_url_params, '') . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
$html .= '</fieldset>';
|
||||
@ -324,7 +319,7 @@ class ReplicationGui
|
||||
__('Skipping errors might lead into unsynchronized master and slave!')
|
||||
)->getDisplay();
|
||||
$html .= ' <ul>';
|
||||
$html .= ' <li><a href="' . $slave_skip_error_link . '">';
|
||||
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_skip_error_link . '">';
|
||||
$html .= __('Skip current error') . '</a></li>';
|
||||
$html .= ' <li>';
|
||||
$html .= ' <form method="post" action="server_replication.php">';
|
||||
@ -358,9 +353,10 @@ class ReplicationGui
|
||||
$html .= sprintf(
|
||||
__(
|
||||
'This server is not configured as master in a replication process. '
|
||||
. 'Would you like to <a href="%s">configure</a> it?'
|
||||
. 'Would you like to %sconfigure%s it?'
|
||||
),
|
||||
'server_replication.php' . Url::getCommon($_url_params)
|
||||
'<a href="server_replication.php" data-post="' . Url::getCommon($_url_params, '') . '">',
|
||||
'</a>'
|
||||
);
|
||||
$html .= '</fieldset>';
|
||||
return $html;
|
||||
@ -693,7 +689,7 @@ class ReplicationGui
|
||||
list($username_length, $hostname_length)
|
||||
= self::getUsernameHostnameLength();
|
||||
|
||||
if (isset($_REQUEST['username']) && strlen($_REQUEST['username']) === 0) {
|
||||
if (isset($_POST['username']) && strlen($_POST['username']) === 0) {
|
||||
$GLOBALS['pred_username'] = 'any';
|
||||
}
|
||||
$html .= '<div id="master_addslaveuser_gui">';
|
||||
@ -732,8 +728,8 @@ class ReplicationGui
|
||||
unset($_current_user);
|
||||
|
||||
// when we start editing a user, $GLOBALS['pred_hostname'] is not defined
|
||||
if (! isset($GLOBALS['pred_hostname']) && isset($_REQUEST['hostname'])) {
|
||||
switch (mb_strtolower($_REQUEST['hostname'])) {
|
||||
if (! isset($GLOBALS['pred_hostname']) && isset($_POST['hostname'])) {
|
||||
switch (mb_strtolower($_POST['hostname'])) {
|
||||
case 'localhost':
|
||||
case '127.0.0.1':
|
||||
$GLOBALS['pred_hostname'] = 'localhost';
|
||||
@ -810,10 +806,10 @@ class ReplicationGui
|
||||
. '</span>'
|
||||
. '<input type="text" name="username" id="pma_username" maxlength="'
|
||||
. $username_length . '" title="' . __('User name') . '"'
|
||||
. (empty($_REQUEST['username']) ? '' : ' value="'
|
||||
. (empty($_POST['username']) ? '' : ' value="'
|
||||
. (isset($GLOBALS['new_username'])
|
||||
? $GLOBALS['new_username']
|
||||
: htmlspecialchars($_REQUEST['username'])) . '"')
|
||||
: htmlspecialchars($_POST['username'])) . '"')
|
||||
. ' />'
|
||||
. '</div>';
|
||||
|
||||
@ -843,7 +839,7 @@ class ReplicationGui
|
||||
. '</span>'
|
||||
. '<input type="text" name="hostname" id="pma_hostname" maxlength="'
|
||||
. $hostname_length . '" value="'
|
||||
. (isset($_REQUEST['hostname']) ? htmlspecialchars($_REQUEST['hostname']) : '')
|
||||
. (isset($_POST['hostname']) ? htmlspecialchars($_POST['hostname']) : '')
|
||||
. '" title="' . __('Host')
|
||||
. '" />'
|
||||
. Util::showHint(
|
||||
@ -861,12 +857,12 @@ class ReplicationGui
|
||||
. ' <select name="pred_password" id="select_pred_password" title="'
|
||||
. __('Password') . '">'
|
||||
. ' <option value="none"';
|
||||
if (isset($_REQUEST['username'])) {
|
||||
if (isset($_POST['username'])) {
|
||||
$html .= ' selected="selected"';
|
||||
}
|
||||
$html .= '>' . __('No Password') . '</option>'
|
||||
. ' <option value="userdefined"'
|
||||
. (isset($_REQUEST['username']) ? '' : ' selected="selected"')
|
||||
. (isset($_POST['username']) ? '' : ' selected="selected"')
|
||||
. '>' . __('Use text field:') . '</option>'
|
||||
. ' </select>'
|
||||
. '</span>'
|
||||
@ -907,22 +903,22 @@ class ReplicationGui
|
||||
*/
|
||||
public static function handleControlRequest()
|
||||
{
|
||||
if (isset($_REQUEST['sr_take_action'])) {
|
||||
if (isset($_POST['sr_take_action'])) {
|
||||
$refresh = false;
|
||||
$result = false;
|
||||
$messageSuccess = null;
|
||||
$messageError = null;
|
||||
|
||||
if (isset($_REQUEST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) {
|
||||
if (isset($_POST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) {
|
||||
$_SESSION['replication']['sr_action_status'] = 'error';
|
||||
$_SESSION['replication']['sr_action_info'] = __('Connection to server is disabled, please enable $cfg[\'AllowArbitraryServer\'] in phpMyAdmin configuration.');
|
||||
} elseif (isset($_REQUEST['slave_changemaster'])) {
|
||||
} elseif (isset($_POST['slave_changemaster'])) {
|
||||
$result = self::handleRequestForSlaveChangeMaster();
|
||||
} elseif (isset($_REQUEST['sr_slave_server_control'])) {
|
||||
} elseif (isset($_POST['sr_slave_server_control'])) {
|
||||
$result = self::handleRequestForSlaveServerControl();
|
||||
$refresh = true;
|
||||
|
||||
switch ($_REQUEST['sr_slave_action']) {
|
||||
switch ($_POST['sr_slave_action']) {
|
||||
case 'start':
|
||||
$messageSuccess = __('Replication started successfully.');
|
||||
$messageError = __('Error starting replication.');
|
||||
@ -940,7 +936,7 @@ class ReplicationGui
|
||||
$messageError = __('Error.');
|
||||
break;
|
||||
}
|
||||
} elseif (isset($_REQUEST['sr_slave_skip_error'])) {
|
||||
} elseif (isset($_POST['sr_slave_skip_error'])) {
|
||||
$result = self::handleRequestForSlaveSkipError();
|
||||
}
|
||||
|
||||
@ -974,13 +970,13 @@ class ReplicationGui
|
||||
{
|
||||
$sr = array();
|
||||
$_SESSION['replication']['m_username'] = $sr['username']
|
||||
= $GLOBALS['dbi']->escapeString($_REQUEST['username']);
|
||||
= $GLOBALS['dbi']->escapeString($_POST['username']);
|
||||
$_SESSION['replication']['m_password'] = $sr['pma_pw']
|
||||
= $GLOBALS['dbi']->escapeString($_REQUEST['pma_pw']);
|
||||
= $GLOBALS['dbi']->escapeString($_POST['pma_pw']);
|
||||
$_SESSION['replication']['m_hostname'] = $sr['hostname']
|
||||
= $GLOBALS['dbi']->escapeString($_REQUEST['hostname']);
|
||||
= $GLOBALS['dbi']->escapeString($_POST['hostname']);
|
||||
$_SESSION['replication']['m_port'] = $sr['port']
|
||||
= $GLOBALS['dbi']->escapeString($_REQUEST['text_port']);
|
||||
= $GLOBALS['dbi']->escapeString($_POST['text_port']);
|
||||
$_SESSION['replication']['m_correct'] = '';
|
||||
$_SESSION['replication']['sr_action_status'] = 'error';
|
||||
$_SESSION['replication']['sr_action_info'] = __('Unknown error');
|
||||
@ -1043,10 +1039,10 @@ class ReplicationGui
|
||||
*/
|
||||
public static function handleRequestForSlaveServerControl()
|
||||
{
|
||||
if (empty($_REQUEST['sr_slave_control_parm'])) {
|
||||
$_REQUEST['sr_slave_control_parm'] = null;
|
||||
if (empty($_POST['sr_slave_control_parm'])) {
|
||||
$_POST['sr_slave_control_parm'] = null;
|
||||
}
|
||||
if ($_REQUEST['sr_slave_action'] == 'reset') {
|
||||
if ($_POST['sr_slave_action'] == 'reset') {
|
||||
$qStop = Replication::slaveControl("STOP");
|
||||
$qReset = $GLOBALS['dbi']->tryQuery("RESET SLAVE;");
|
||||
$qStart = Replication::slaveControl("START");
|
||||
@ -1056,8 +1052,8 @@ class ReplicationGui
|
||||
$qStart !== false && $qStart !== -1);
|
||||
} else {
|
||||
$qControl = Replication::slaveControl(
|
||||
$_REQUEST['sr_slave_action'],
|
||||
$_REQUEST['sr_slave_control_parm']
|
||||
$_POST['sr_slave_action'],
|
||||
$_POST['sr_slave_control_parm']
|
||||
);
|
||||
|
||||
$result = ($qControl !== false && $qControl !== -1);
|
||||
@ -1074,8 +1070,8 @@ class ReplicationGui
|
||||
public static function handleRequestForSlaveSkipError()
|
||||
{
|
||||
$count = 1;
|
||||
if (isset($_REQUEST['sr_skip_errors_count'])) {
|
||||
$count = $_REQUEST['sr_skip_errors_count'] * 1;
|
||||
if (isset($_POST['sr_skip_errors_count'])) {
|
||||
$count = $_POST['sr_skip_errors_count'] * 1;
|
||||
}
|
||||
|
||||
$qStop = Replication::slaveControl("STOP");
|
||||
|
||||
@ -97,8 +97,8 @@ class Events
|
||||
{
|
||||
global $_REQUEST, $_POST, $errors, $db;
|
||||
|
||||
if (! empty($_REQUEST['editor_process_add'])
|
||||
|| ! empty($_REQUEST['editor_process_edit'])
|
||||
if (! empty($_POST['editor_process_add'])
|
||||
|| ! empty($_POST['editor_process_edit'])
|
||||
) {
|
||||
$sql_query = '';
|
||||
|
||||
@ -106,15 +106,15 @@ class Events
|
||||
|
||||
if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest()
|
||||
// Execute the created query
|
||||
if (! empty($_REQUEST['editor_process_edit'])) {
|
||||
if (! empty($_POST['editor_process_edit'])) {
|
||||
// Backup the old trigger, in case something goes wrong
|
||||
$create_item = $GLOBALS['dbi']->getDefinition(
|
||||
$db,
|
||||
'EVENT',
|
||||
$_REQUEST['item_original_name']
|
||||
$_POST['item_original_name']
|
||||
);
|
||||
$drop_item = "DROP EVENT "
|
||||
. Util::backquote($_REQUEST['item_original_name'])
|
||||
. Util::backquote($_POST['item_original_name'])
|
||||
. ";\n";
|
||||
$result = $GLOBALS['dbi']->tryQuery($drop_item);
|
||||
if (! $result) {
|
||||
@ -149,7 +149,7 @@ class Events
|
||||
__('Event %1$s has been modified.')
|
||||
);
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
$sql_query = $drop_item . $item_query;
|
||||
}
|
||||
@ -169,7 +169,7 @@ class Events
|
||||
__('Event %1$s has been created.')
|
||||
);
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
$sql_query = $item_query;
|
||||
}
|
||||
@ -195,12 +195,12 @@ class Events
|
||||
$response = Response::getInstance();
|
||||
if ($response->isAjax()) {
|
||||
if ($message->isSuccess()) {
|
||||
$events = $GLOBALS['dbi']->getEvents($db, $_REQUEST['item_name']);
|
||||
$events = $GLOBALS['dbi']->getEvents($db, $_POST['item_name']);
|
||||
$event = $events[0];
|
||||
$response->addJSON(
|
||||
'name',
|
||||
htmlspecialchars(
|
||||
mb_strtoupper($_REQUEST['item_name'])
|
||||
mb_strtoupper($_POST['item_name'])
|
||||
)
|
||||
);
|
||||
if (! empty($event)) {
|
||||
@ -219,14 +219,14 @@ class Events
|
||||
* Display a form used to add/edit a trigger, if necessary
|
||||
*/
|
||||
if (count($errors)
|
||||
|| (empty($_REQUEST['editor_process_add'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
|| (empty($_POST['editor_process_add'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
&& (! empty($_REQUEST['add_item'])
|
||||
|| ! empty($_REQUEST['edit_item'])
|
||||
|| ! empty($_REQUEST['item_changetype'])))
|
||||
|| ! empty($_POST['item_changetype'])))
|
||||
) { // FIXME: this must be simpler than that
|
||||
$operation = '';
|
||||
if (! empty($_REQUEST['item_changetype'])) {
|
||||
if (! empty($_POST['item_changetype'])) {
|
||||
$operation = 'change';
|
||||
}
|
||||
// Get the data for the form (if any)
|
||||
@ -237,8 +237,8 @@ class Events
|
||||
} elseif (! empty($_REQUEST['edit_item'])) {
|
||||
$title = __("Edit event");
|
||||
if (! empty($_REQUEST['item_name'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
&& empty($_REQUEST['item_changetype'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
&& empty($_POST['item_changetype'])
|
||||
) {
|
||||
$item = self::getDataFromName($_REQUEST['item_name']);
|
||||
if ($item !== false) {
|
||||
@ -274,11 +274,11 @@ class Events
|
||||
'item_comment',
|
||||
'item_definer');
|
||||
foreach ($indices as $index) {
|
||||
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
|
||||
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
|
||||
}
|
||||
$retval['item_type'] = 'ONE TIME';
|
||||
$retval['item_type_toggle'] = 'RECURRING';
|
||||
if (isset($_REQUEST['item_type']) && $_REQUEST['item_type'] == 'RECURRING') {
|
||||
if (isset($_POST['item_type']) && $_POST['item_type'] == 'RECURRING') {
|
||||
$retval['item_type'] = 'RECURRING';
|
||||
$retval['item_type_toggle'] = 'ONE TIME';
|
||||
}
|
||||
@ -545,10 +545,10 @@ class Events
|
||||
global $_REQUEST, $errors, $event_status, $event_type, $event_interval;
|
||||
|
||||
$query = 'CREATE ';
|
||||
if (! empty($_REQUEST['item_definer'])) {
|
||||
if (mb_strpos($_REQUEST['item_definer'], '@') !== false
|
||||
if (! empty($_POST['item_definer'])) {
|
||||
if (mb_strpos($_POST['item_definer'], '@') !== false
|
||||
) {
|
||||
$arr = explode('@', $_REQUEST['item_definer']);
|
||||
$arr = explode('@', $_POST['item_definer']);
|
||||
$query .= 'DEFINER=' . Util::backquote($arr[0]);
|
||||
$query .= '@' . Util::backquote($arr[1]) . ' ';
|
||||
} else {
|
||||
@ -556,40 +556,40 @@ class Events
|
||||
}
|
||||
}
|
||||
$query .= 'EVENT ';
|
||||
if (! empty($_REQUEST['item_name'])) {
|
||||
$query .= Util::backquote($_REQUEST['item_name']) . ' ';
|
||||
if (! empty($_POST['item_name'])) {
|
||||
$query .= Util::backquote($_POST['item_name']) . ' ';
|
||||
} else {
|
||||
$errors[] = __('You must provide an event name!');
|
||||
}
|
||||
$query .= 'ON SCHEDULE ';
|
||||
if (! empty($_REQUEST['item_type'])
|
||||
&& in_array($_REQUEST['item_type'], $event_type)
|
||||
if (! empty($_POST['item_type'])
|
||||
&& in_array($_POST['item_type'], $event_type)
|
||||
) {
|
||||
if ($_REQUEST['item_type'] == 'RECURRING') {
|
||||
if (! empty($_REQUEST['item_interval_value'])
|
||||
&& !empty($_REQUEST['item_interval_field'])
|
||||
&& in_array($_REQUEST['item_interval_field'], $event_interval)
|
||||
if ($_POST['item_type'] == 'RECURRING') {
|
||||
if (! empty($_POST['item_interval_value'])
|
||||
&& !empty($_POST['item_interval_field'])
|
||||
&& in_array($_POST['item_interval_field'], $event_interval)
|
||||
) {
|
||||
$query .= 'EVERY ' . intval($_REQUEST['item_interval_value']) . ' ';
|
||||
$query .= $_REQUEST['item_interval_field'] . ' ';
|
||||
$query .= 'EVERY ' . intval($_POST['item_interval_value']) . ' ';
|
||||
$query .= $_POST['item_interval_field'] . ' ';
|
||||
} else {
|
||||
$errors[]
|
||||
= __('You must provide a valid interval value for the event.');
|
||||
}
|
||||
if (! empty($_REQUEST['item_starts'])) {
|
||||
if (! empty($_POST['item_starts'])) {
|
||||
$query .= "STARTS '"
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['item_starts'])
|
||||
. $GLOBALS['dbi']->escapeString($_POST['item_starts'])
|
||||
. "' ";
|
||||
}
|
||||
if (! empty($_REQUEST['item_ends'])) {
|
||||
if (! empty($_POST['item_ends'])) {
|
||||
$query .= "ENDS '"
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['item_ends'])
|
||||
. $GLOBALS['dbi']->escapeString($_POST['item_ends'])
|
||||
. "' ";
|
||||
}
|
||||
} else {
|
||||
if (! empty($_REQUEST['item_execute_at'])) {
|
||||
if (! empty($_POST['item_execute_at'])) {
|
||||
$query .= "AT '"
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['item_execute_at'])
|
||||
. $GLOBALS['dbi']->escapeString($_POST['item_execute_at'])
|
||||
. "' ";
|
||||
} else {
|
||||
$errors[]
|
||||
@ -600,26 +600,26 @@ class Events
|
||||
$errors[] = __('You must provide a valid type for the event.');
|
||||
}
|
||||
$query .= 'ON COMPLETION ';
|
||||
if (empty($_REQUEST['item_preserve'])) {
|
||||
if (empty($_POST['item_preserve'])) {
|
||||
$query .= 'NOT ';
|
||||
}
|
||||
$query .= 'PRESERVE ';
|
||||
if (! empty($_REQUEST['item_status'])) {
|
||||
if (! empty($_POST['item_status'])) {
|
||||
foreach ($event_status['display'] as $key => $value) {
|
||||
if ($value == $_REQUEST['item_status']) {
|
||||
if ($value == $_POST['item_status']) {
|
||||
$query .= $event_status['query'][$key] . ' ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_comment'])) {
|
||||
if (! empty($_POST['item_comment'])) {
|
||||
$query .= "COMMENT '" . $GLOBALS['dbi']->escapeString(
|
||||
$_REQUEST['item_comment']
|
||||
$_POST['item_comment']
|
||||
) . "' ";
|
||||
}
|
||||
$query .= 'DO ';
|
||||
if (! empty($_REQUEST['item_definition'])) {
|
||||
$query .= $_REQUEST['item_definition'];
|
||||
if (! empty($_POST['item_definition'])) {
|
||||
$query .= $_POST['item_definition'];
|
||||
} else {
|
||||
$errors[] = __('You must provide an event definition.');
|
||||
}
|
||||
|
||||
@ -117,21 +117,21 @@ class Routines
|
||||
*/
|
||||
// FIXME: this must be simpler than that
|
||||
if (count($errors)
|
||||
|| ( empty($_REQUEST['editor_process_add'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
|| ( empty($_POST['editor_process_add'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
&& (! empty($_REQUEST['add_item']) || ! empty($_REQUEST['edit_item'])
|
||||
|| ! empty($_REQUEST['routine_addparameter'])
|
||||
|| ! empty($_REQUEST['routine_removeparameter'])
|
||||
|| ! empty($_REQUEST['routine_changetype'])))
|
||||
|| ! empty($_POST['routine_addparameter'])
|
||||
|| ! empty($_POST['routine_removeparameter'])
|
||||
|| ! empty($_POST['routine_changetype'])))
|
||||
) {
|
||||
// Handle requests to add/remove parameters and changing routine type
|
||||
// This is necessary when JS is disabled
|
||||
$operation = '';
|
||||
if (! empty($_REQUEST['routine_addparameter'])) {
|
||||
if (! empty($_POST['routine_addparameter'])) {
|
||||
$operation = 'add';
|
||||
} elseif (! empty($_REQUEST['routine_removeparameter'])) {
|
||||
} elseif (! empty($_POST['routine_removeparameter'])) {
|
||||
$operation = 'remove';
|
||||
} elseif (! empty($_REQUEST['routine_changetype'])) {
|
||||
} elseif (! empty($_POST['routine_changetype'])) {
|
||||
$operation = 'change';
|
||||
}
|
||||
// Get the data for the form (if any)
|
||||
@ -141,11 +141,11 @@ class Routines
|
||||
$mode = 'add';
|
||||
} elseif (! empty($_REQUEST['edit_item'])) {
|
||||
$title = __("Edit routine");
|
||||
if (! $operation && ! empty($_REQUEST['item_name'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
if (! $operation && ! empty($_GET['item_name'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
) {
|
||||
$routine = self::getDataFromName(
|
||||
$_REQUEST['item_name'], $_REQUEST['item_type']
|
||||
$_GET['item_name'], $_GET['item_type']
|
||||
);
|
||||
if ($routine !== false) {
|
||||
$routine['item_original_name'] = $routine['item_name'];
|
||||
@ -200,8 +200,8 @@ class Routines
|
||||
*/
|
||||
public static function handleRequestCreateOrEdit(array $errors, $db)
|
||||
{
|
||||
if (empty($_REQUEST['editor_process_add'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
if (empty($_POST['editor_process_add'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
) {
|
||||
return $errors;
|
||||
}
|
||||
@ -210,29 +210,29 @@ class Routines
|
||||
$routine_query = self::getQueryFromRequest();
|
||||
if (!count($errors)) { // set by self::getQueryFromRequest()
|
||||
// Execute the created query
|
||||
if (!empty($_REQUEST['editor_process_edit'])) {
|
||||
if (!empty($_POST['editor_process_edit'])) {
|
||||
$isProcOrFunc = in_array(
|
||||
$_REQUEST['item_original_type'],
|
||||
$_POST['item_original_type'],
|
||||
array('PROCEDURE', 'FUNCTION')
|
||||
);
|
||||
|
||||
if (!$isProcOrFunc) {
|
||||
$errors[] = sprintf(
|
||||
__('Invalid routine type: "%s"'),
|
||||
htmlspecialchars($_REQUEST['item_original_type'])
|
||||
htmlspecialchars($_POST['item_original_type'])
|
||||
);
|
||||
} else {
|
||||
// Backup the old routine, in case something goes wrong
|
||||
$create_routine = $GLOBALS['dbi']->getDefinition(
|
||||
$db,
|
||||
$_REQUEST['item_original_type'],
|
||||
$_REQUEST['item_original_name']
|
||||
$_POST['item_original_type'],
|
||||
$_POST['item_original_name']
|
||||
);
|
||||
|
||||
$privilegesBackup = self::backupPrivileges();
|
||||
|
||||
$drop_routine = "DROP {$_REQUEST['item_original_type']} "
|
||||
. Util::backquote($_REQUEST['item_original_name'])
|
||||
$drop_routine = "DROP {$_POST['item_original_type']} "
|
||||
. Util::backquote($_POST['item_original_name'])
|
||||
. ";\n";
|
||||
$result = $GLOBALS['dbi']->tryQuery($drop_routine);
|
||||
if (!$result) {
|
||||
@ -274,7 +274,7 @@ class Routines
|
||||
__('Routine %1$s has been created.')
|
||||
);
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
$sql_query = $routine_query;
|
||||
}
|
||||
@ -309,14 +309,14 @@ class Routines
|
||||
|
||||
$routines = $GLOBALS['dbi']->getRoutines(
|
||||
$db,
|
||||
$_REQUEST['item_type'],
|
||||
$_REQUEST['item_name']
|
||||
$_POST['item_type'],
|
||||
$_POST['item_name']
|
||||
);
|
||||
$routine = $routines[0];
|
||||
$response->addJSON(
|
||||
'name',
|
||||
htmlspecialchars(
|
||||
mb_strtoupper($_REQUEST['item_name'])
|
||||
mb_strtoupper($_POST['item_name'])
|
||||
)
|
||||
);
|
||||
$response->addJSON('new_row', RteList::getRoutineRow($routine));
|
||||
@ -337,9 +337,9 @@ class Routines
|
||||
}
|
||||
|
||||
// Backup the Old Privileges before dropping
|
||||
// if $_REQUEST['item_adjust_privileges'] set
|
||||
if (! isset($_REQUEST['item_adjust_privileges'])
|
||||
|| empty($_REQUEST['item_adjust_privileges'])
|
||||
// if $_POST['item_adjust_privileges'] set
|
||||
if (! isset($_POST['item_adjust_privileges'])
|
||||
|| empty($_POST['item_adjust_privileges'])
|
||||
) {
|
||||
return array();
|
||||
}
|
||||
@ -348,8 +348,8 @@ class Routines
|
||||
'mysql'
|
||||
)
|
||||
. '.' . Util::backquote('procs_priv')
|
||||
. ' where Routine_name = "' . $_REQUEST['item_original_name']
|
||||
. '" AND Routine_type = "' . $_REQUEST['item_original_type']
|
||||
. ' where Routine_name = "' . $_POST['item_original_name']
|
||||
. '" AND Routine_type = "' . $_POST['item_original_type']
|
||||
. '";';
|
||||
|
||||
$privilegesBackup = $GLOBALS['dbi']->fetchResult(
|
||||
@ -414,8 +414,8 @@ class Routines
|
||||
. Util::backquote('procs_priv')
|
||||
. ' VALUES("' . $priv[0] . '", "'
|
||||
. $priv[1] . '", "' . $priv[2] . '", "'
|
||||
. $_REQUEST['item_name'] . '", "'
|
||||
. $_REQUEST['item_type'] . '", "'
|
||||
. $_POST['item_name'] . '", "'
|
||||
. $_POST['item_type'] . '", "'
|
||||
. $priv[5] . '", "'
|
||||
. $priv[6] . '", "'
|
||||
. $priv[7] . '");';
|
||||
@ -455,7 +455,7 @@ class Routines
|
||||
);
|
||||
}
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
|
||||
return $message;
|
||||
@ -483,7 +483,7 @@ class Routines
|
||||
'item_comment',
|
||||
'item_definer');
|
||||
foreach ($indices as $index) {
|
||||
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
|
||||
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
|
||||
}
|
||||
|
||||
$retval['item_type'] = 'PROCEDURE';
|
||||
@ -493,8 +493,8 @@ class Routines
|
||||
$retval['item_type_toggle'] = 'PROCEDURE';
|
||||
}
|
||||
$retval['item_original_type'] = 'PROCEDURE';
|
||||
if (isset($_REQUEST['item_original_type'])
|
||||
&& $_REQUEST['item_original_type'] == 'FUNCTION'
|
||||
if (isset($_POST['item_original_type'])
|
||||
&& $_POST['item_original_type'] == 'FUNCTION'
|
||||
) {
|
||||
$retval['item_original_type'] = 'FUNCTION';
|
||||
}
|
||||
@ -505,35 +505,35 @@ class Routines
|
||||
$retval['item_param_length'] = array();
|
||||
$retval['item_param_opts_num'] = array();
|
||||
$retval['item_param_opts_text'] = array();
|
||||
if (isset($_REQUEST['item_param_name'])
|
||||
&& isset($_REQUEST['item_param_type'])
|
||||
&& isset($_REQUEST['item_param_length'])
|
||||
&& isset($_REQUEST['item_param_opts_num'])
|
||||
&& isset($_REQUEST['item_param_opts_text'])
|
||||
&& is_array($_REQUEST['item_param_name'])
|
||||
&& is_array($_REQUEST['item_param_type'])
|
||||
&& is_array($_REQUEST['item_param_length'])
|
||||
&& is_array($_REQUEST['item_param_opts_num'])
|
||||
&& is_array($_REQUEST['item_param_opts_text'])
|
||||
if (isset($_POST['item_param_name'])
|
||||
&& isset($_POST['item_param_type'])
|
||||
&& isset($_POST['item_param_length'])
|
||||
&& isset($_POST['item_param_opts_num'])
|
||||
&& isset($_POST['item_param_opts_text'])
|
||||
&& is_array($_POST['item_param_name'])
|
||||
&& is_array($_POST['item_param_type'])
|
||||
&& is_array($_POST['item_param_length'])
|
||||
&& is_array($_POST['item_param_opts_num'])
|
||||
&& is_array($_POST['item_param_opts_text'])
|
||||
) {
|
||||
if ($_REQUEST['item_type'] == 'PROCEDURE') {
|
||||
$retval['item_param_dir'] = $_REQUEST['item_param_dir'];
|
||||
if ($_POST['item_type'] == 'PROCEDURE') {
|
||||
$retval['item_param_dir'] = $_POST['item_param_dir'];
|
||||
foreach ($retval['item_param_dir'] as $key => $value) {
|
||||
if (! in_array($value, $param_directions, true)) {
|
||||
$retval['item_param_dir'][$key] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
$retval['item_param_name'] = $_REQUEST['item_param_name'];
|
||||
$retval['item_param_type'] = $_REQUEST['item_param_type'];
|
||||
$retval['item_param_name'] = $_POST['item_param_name'];
|
||||
$retval['item_param_type'] = $_POST['item_param_type'];
|
||||
foreach ($retval['item_param_type'] as $key => $value) {
|
||||
if (! in_array($value, Util::getSupportedDatatypes(), true)) {
|
||||
$retval['item_param_type'][$key] = '';
|
||||
}
|
||||
}
|
||||
$retval['item_param_length'] = $_REQUEST['item_param_length'];
|
||||
$retval['item_param_opts_num'] = $_REQUEST['item_param_opts_num'];
|
||||
$retval['item_param_opts_text'] = $_REQUEST['item_param_opts_text'];
|
||||
$retval['item_param_length'] = $_POST['item_param_length'];
|
||||
$retval['item_param_opts_num'] = $_POST['item_param_opts_num'];
|
||||
$retval['item_param_opts_text'] = $_POST['item_param_opts_text'];
|
||||
$retval['item_num_params'] = max(
|
||||
count($retval['item_param_name']),
|
||||
count($retval['item_param_type']),
|
||||
@ -543,32 +543,32 @@ class Routines
|
||||
);
|
||||
}
|
||||
$retval['item_returntype'] = '';
|
||||
if (isset($_REQUEST['item_returntype'])
|
||||
&& in_array($_REQUEST['item_returntype'], Util::getSupportedDatatypes())
|
||||
if (isset($_POST['item_returntype'])
|
||||
&& in_array($_POST['item_returntype'], Util::getSupportedDatatypes())
|
||||
) {
|
||||
$retval['item_returntype'] = $_REQUEST['item_returntype'];
|
||||
$retval['item_returntype'] = $_POST['item_returntype'];
|
||||
}
|
||||
|
||||
$retval['item_isdeterministic'] = '';
|
||||
if (isset($_REQUEST['item_isdeterministic'])
|
||||
&& mb_strtolower($_REQUEST['item_isdeterministic']) == 'on'
|
||||
if (isset($_POST['item_isdeterministic'])
|
||||
&& mb_strtolower($_POST['item_isdeterministic']) == 'on'
|
||||
) {
|
||||
$retval['item_isdeterministic'] = " checked='checked'";
|
||||
}
|
||||
$retval['item_securitytype_definer'] = '';
|
||||
$retval['item_securitytype_invoker'] = '';
|
||||
if (isset($_REQUEST['item_securitytype'])) {
|
||||
if ($_REQUEST['item_securitytype'] === 'DEFINER') {
|
||||
if (isset($_POST['item_securitytype'])) {
|
||||
if ($_POST['item_securitytype'] === 'DEFINER') {
|
||||
$retval['item_securitytype_definer'] = " selected='selected'";
|
||||
} elseif ($_REQUEST['item_securitytype'] === 'INVOKER') {
|
||||
} elseif ($_POST['item_securitytype'] === 'INVOKER') {
|
||||
$retval['item_securitytype_invoker'] = " selected='selected'";
|
||||
}
|
||||
}
|
||||
$retval['item_sqldataaccess'] = '';
|
||||
if (isset($_REQUEST['item_sqldataaccess'])
|
||||
&& in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess, true)
|
||||
if (isset($_POST['item_sqldataaccess'])
|
||||
&& in_array($_POST['item_sqldataaccess'], $param_sqldataaccess, true)
|
||||
) {
|
||||
$retval['item_sqldataaccess'] = $_REQUEST['item_sqldataaccess'];
|
||||
$retval['item_sqldataaccess'] = $_POST['item_sqldataaccess'];
|
||||
}
|
||||
|
||||
return $retval;
|
||||
@ -1099,13 +1099,13 @@ class Routines
|
||||
{
|
||||
global $_REQUEST, $errors, $param_sqldataaccess, $param_directions, $dbi;
|
||||
|
||||
$_REQUEST['item_type'] = isset($_REQUEST['item_type'])
|
||||
? $_REQUEST['item_type'] : '';
|
||||
$_POST['item_type'] = isset($_POST['item_type'])
|
||||
? $_POST['item_type'] : '';
|
||||
|
||||
$query = 'CREATE ';
|
||||
if (! empty($_REQUEST['item_definer'])) {
|
||||
if (mb_strpos($_REQUEST['item_definer'], '@') !== false) {
|
||||
$arr = explode('@', $_REQUEST['item_definer']);
|
||||
if (! empty($_POST['item_definer'])) {
|
||||
if (mb_strpos($_POST['item_definer'], '@') !== false) {
|
||||
$arr = explode('@', $_POST['item_definer']);
|
||||
|
||||
$do_backquote = true;
|
||||
if (substr($arr[0], 0, 1) === "`"
|
||||
@ -1126,18 +1126,18 @@ class Routines
|
||||
$errors[] = __('The definer must be in the "username@hostname" format!');
|
||||
}
|
||||
}
|
||||
if ($_REQUEST['item_type'] == 'FUNCTION'
|
||||
|| $_REQUEST['item_type'] == 'PROCEDURE'
|
||||
if ($_POST['item_type'] == 'FUNCTION'
|
||||
|| $_POST['item_type'] == 'PROCEDURE'
|
||||
) {
|
||||
$query .= $_REQUEST['item_type'] . ' ';
|
||||
$query .= $_POST['item_type'] . ' ';
|
||||
} else {
|
||||
$errors[] = sprintf(
|
||||
__('Invalid routine type: "%s"'),
|
||||
htmlspecialchars($_REQUEST['item_type'])
|
||||
htmlspecialchars($_POST['item_type'])
|
||||
);
|
||||
}
|
||||
if (! empty($_REQUEST['item_name'])) {
|
||||
$query .= Util::backquote($_REQUEST['item_name']);
|
||||
if (! empty($_POST['item_name'])) {
|
||||
$query .= Util::backquote($_POST['item_name']);
|
||||
} else {
|
||||
$errors[] = __('You must provide a routine name!');
|
||||
}
|
||||
@ -1145,36 +1145,36 @@ class Routines
|
||||
$warned_about_dir = false;
|
||||
$warned_about_length = false;
|
||||
|
||||
if (! empty($_REQUEST['item_param_name'])
|
||||
&& ! empty($_REQUEST['item_param_type'])
|
||||
&& ! empty($_REQUEST['item_param_length'])
|
||||
&& is_array($_REQUEST['item_param_name'])
|
||||
&& is_array($_REQUEST['item_param_type'])
|
||||
&& is_array($_REQUEST['item_param_length'])
|
||||
if (! empty($_POST['item_param_name'])
|
||||
&& ! empty($_POST['item_param_type'])
|
||||
&& ! empty($_POST['item_param_length'])
|
||||
&& is_array($_POST['item_param_name'])
|
||||
&& is_array($_POST['item_param_type'])
|
||||
&& is_array($_POST['item_param_length'])
|
||||
) {
|
||||
$item_param_name = $_REQUEST['item_param_name'];
|
||||
$item_param_type = $_REQUEST['item_param_type'];
|
||||
$item_param_length = $_REQUEST['item_param_length'];
|
||||
$item_param_name = $_POST['item_param_name'];
|
||||
$item_param_type = $_POST['item_param_type'];
|
||||
$item_param_length = $_POST['item_param_length'];
|
||||
|
||||
for ($i=0, $nb = count($item_param_name); $i < $nb; $i++) {
|
||||
if (! empty($item_param_name[$i])
|
||||
&& ! empty($item_param_type[$i])
|
||||
) {
|
||||
if ($_REQUEST['item_type'] == 'PROCEDURE'
|
||||
&& ! empty($_REQUEST['item_param_dir'][$i])
|
||||
&& in_array($_REQUEST['item_param_dir'][$i], $param_directions)
|
||||
if ($_POST['item_type'] == 'PROCEDURE'
|
||||
&& ! empty($_POST['item_param_dir'][$i])
|
||||
&& in_array($_POST['item_param_dir'][$i], $param_directions)
|
||||
) {
|
||||
$params .= $_REQUEST['item_param_dir'][$i] . " "
|
||||
$params .= $_POST['item_param_dir'][$i] . " "
|
||||
. Util::backquote($item_param_name[$i])
|
||||
. " " . $item_param_type[$i];
|
||||
} elseif ($_REQUEST['item_type'] == 'FUNCTION') {
|
||||
} elseif ($_POST['item_type'] == 'FUNCTION') {
|
||||
$params .= Util::backquote($item_param_name[$i])
|
||||
. " " . $item_param_type[$i];
|
||||
} elseif (! $warned_about_dir) {
|
||||
$warned_about_dir = true;
|
||||
$errors[] = sprintf(
|
||||
__('Invalid direction "%s" given for parameter.'),
|
||||
htmlspecialchars($_REQUEST['item_param_dir'][$i])
|
||||
htmlspecialchars($_POST['item_param_dir'][$i])
|
||||
);
|
||||
}
|
||||
if ($item_param_length[$i] != ''
|
||||
@ -1200,21 +1200,21 @@ class Routines
|
||||
);
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_param_opts_text'][$i])) {
|
||||
if (! empty($_POST['item_param_opts_text'][$i])) {
|
||||
if ($dbi->types->getTypeClass($item_param_type[$i]) == 'CHAR') {
|
||||
if(! in_array($item_param_type[$i], array('VARBINARY', 'BINARY'))) {
|
||||
$params .= ' CHARSET '
|
||||
. mb_strtolower(
|
||||
$_REQUEST['item_param_opts_text'][$i]
|
||||
$_POST['item_param_opts_text'][$i]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_param_opts_num'][$i])) {
|
||||
if (! empty($_POST['item_param_opts_num'][$i])) {
|
||||
if ($dbi->types->getTypeClass($item_param_type[$i]) == 'NUMBER') {
|
||||
$params .= ' '
|
||||
. mb_strtoupper(
|
||||
$_REQUEST['item_param_opts_num'][$i]
|
||||
$_POST['item_param_opts_num'][$i]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1230,9 +1230,9 @@ class Routines
|
||||
}
|
||||
}
|
||||
$query .= "(" . $params . ") ";
|
||||
if ($_REQUEST['item_type'] == 'FUNCTION') {
|
||||
$item_returntype = isset($_REQUEST['item_returntype'])
|
||||
? $_REQUEST['item_returntype']
|
||||
if ($_POST['item_type'] == 'FUNCTION') {
|
||||
$item_returntype = isset($_POST['item_returntype'])
|
||||
? $_POST['item_returntype']
|
||||
: null;
|
||||
|
||||
if (! empty($item_returntype)
|
||||
@ -1244,15 +1244,15 @@ class Routines
|
||||
} else {
|
||||
$errors[] = __('You must provide a valid return type for the routine.');
|
||||
}
|
||||
if (! empty($_REQUEST['item_returnlength'])
|
||||
if (! empty($_POST['item_returnlength'])
|
||||
&& !preg_match(
|
||||
'@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|'
|
||||
. 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN)$@i',
|
||||
$item_returntype
|
||||
)
|
||||
) {
|
||||
$query .= "(" . $_REQUEST['item_returnlength'] . ")";
|
||||
} elseif (empty($_REQUEST['item_returnlength'])
|
||||
$query .= "(" . $_POST['item_returnlength'] . ")";
|
||||
} elseif (empty($_POST['item_returnlength'])
|
||||
&& preg_match(
|
||||
'@^(ENUM|SET|VARCHAR|VARBINARY)$@i', $item_returntype
|
||||
)
|
||||
@ -1264,43 +1264,43 @@ class Routines
|
||||
);
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_returnopts_text'])) {
|
||||
if (! empty($_POST['item_returnopts_text'])) {
|
||||
if ($dbi->types->getTypeClass($item_returntype) == 'CHAR') {
|
||||
$query .= ' CHARSET '
|
||||
. mb_strtolower($_REQUEST['item_returnopts_text']);
|
||||
. mb_strtolower($_POST['item_returnopts_text']);
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_returnopts_num'])) {
|
||||
if (! empty($_POST['item_returnopts_num'])) {
|
||||
if ($dbi->types->getTypeClass($item_returntype) == 'NUMBER') {
|
||||
$query .= ' '
|
||||
. mb_strtoupper($_REQUEST['item_returnopts_num']);
|
||||
. mb_strtoupper($_POST['item_returnopts_num']);
|
||||
}
|
||||
}
|
||||
$query .= ' ';
|
||||
}
|
||||
if (! empty($_REQUEST['item_comment'])) {
|
||||
$query .= "COMMENT '" . $GLOBALS['dbi']->escapeString($_REQUEST['item_comment'])
|
||||
if (! empty($_POST['item_comment'])) {
|
||||
$query .= "COMMENT '" . $GLOBALS['dbi']->escapeString($_POST['item_comment'])
|
||||
. "' ";
|
||||
}
|
||||
if (isset($_REQUEST['item_isdeterministic'])) {
|
||||
if (isset($_POST['item_isdeterministic'])) {
|
||||
$query .= 'DETERMINISTIC ';
|
||||
} else {
|
||||
$query .= 'NOT DETERMINISTIC ';
|
||||
}
|
||||
if (! empty($_REQUEST['item_sqldataaccess'])
|
||||
&& in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess)
|
||||
if (! empty($_POST['item_sqldataaccess'])
|
||||
&& in_array($_POST['item_sqldataaccess'], $param_sqldataaccess)
|
||||
) {
|
||||
$query .= $_REQUEST['item_sqldataaccess'] . ' ';
|
||||
$query .= $_POST['item_sqldataaccess'] . ' ';
|
||||
}
|
||||
if (! empty($_REQUEST['item_securitytype'])) {
|
||||
if ($_REQUEST['item_securitytype'] == 'DEFINER'
|
||||
|| $_REQUEST['item_securitytype'] == 'INVOKER'
|
||||
if (! empty($_POST['item_securitytype'])) {
|
||||
if ($_POST['item_securitytype'] == 'DEFINER'
|
||||
|| $_POST['item_securitytype'] == 'INVOKER'
|
||||
) {
|
||||
$query .= 'SQL SECURITY ' . $_REQUEST['item_securitytype'] . ' ';
|
||||
$query .= 'SQL SECURITY ' . $_POST['item_securitytype'] . ' ';
|
||||
}
|
||||
}
|
||||
if (! empty($_REQUEST['item_definition'])) {
|
||||
$query .= $_REQUEST['item_definition'];
|
||||
if (! empty($_POST['item_definition'])) {
|
||||
$query .= $_POST['item_definition'];
|
||||
} else {
|
||||
$errors[] = __('You must provide a routine definition.');
|
||||
}
|
||||
@ -1322,16 +1322,16 @@ class Routines
|
||||
/**
|
||||
* Handle all user requests other than the default of listing routines
|
||||
*/
|
||||
if (! empty($_REQUEST['execute_routine']) && ! empty($_REQUEST['item_name'])) {
|
||||
if (! empty($_POST['execute_routine']) && ! empty($_POST['item_name'])) {
|
||||
// Build the queries
|
||||
$routine = self::getDataFromName(
|
||||
$_REQUEST['item_name'], $_REQUEST['item_type'], false
|
||||
$_POST['item_name'], $_POST['item_type'], false
|
||||
);
|
||||
if ($routine === false) {
|
||||
$message = __('Error in processing request:') . ' ';
|
||||
$message .= sprintf(
|
||||
Words::get('not_found'),
|
||||
htmlspecialchars(Util::backquote($_REQUEST['item_name'])),
|
||||
htmlspecialchars(Util::backquote($_POST['item_name'])),
|
||||
htmlspecialchars(Util::backquote($db))
|
||||
);
|
||||
$message = Message::error($message);
|
||||
@ -1350,20 +1350,20 @@ class Routines
|
||||
$args = array();
|
||||
$all_functions = $GLOBALS['dbi']->types->getAllFunctions();
|
||||
for ($i = 0; $i < $routine['item_num_params']; $i++) {
|
||||
if (isset($_REQUEST['params'][$routine['item_param_name'][$i]])) {
|
||||
$value = $_REQUEST['params'][$routine['item_param_name'][$i]];
|
||||
if (isset($_POST['params'][$routine['item_param_name'][$i]])) {
|
||||
$value = $_POST['params'][$routine['item_param_name'][$i]];
|
||||
if (is_array($value)) { // is SET type
|
||||
$value = implode(',', $value);
|
||||
}
|
||||
$value = $GLOBALS['dbi']->escapeString($value);
|
||||
if (! empty($_REQUEST['funcs'][$routine['item_param_name'][$i]])
|
||||
if (! empty($_POST['funcs'][$routine['item_param_name'][$i]])
|
||||
&& in_array(
|
||||
$_REQUEST['funcs'][$routine['item_param_name'][$i]],
|
||||
$_POST['funcs'][$routine['item_param_name'][$i]],
|
||||
$all_functions
|
||||
)
|
||||
) {
|
||||
$queries[] = "SET @p$i="
|
||||
. $_REQUEST['funcs'][$routine['item_param_name'][$i]]
|
||||
. $_POST['funcs'][$routine['item_param_name'][$i]]
|
||||
. "('$value');\n";
|
||||
} else {
|
||||
$queries[] = "SET @p$i='$value';\n";
|
||||
@ -1541,7 +1541,7 @@ class Routines
|
||||
$message = __('Error in processing request:') . ' ';
|
||||
$message .= sprintf(
|
||||
Words::get('not_found'),
|
||||
htmlspecialchars(Util::backquote($_REQUEST['item_name'])),
|
||||
htmlspecialchars(Util::backquote($_GET['item_name'])),
|
||||
htmlspecialchars(Util::backquote($db))
|
||||
);
|
||||
$message = Message::error($message);
|
||||
|
||||
@ -77,8 +77,8 @@ class Triggers
|
||||
{
|
||||
global $_REQUEST, $_POST, $errors, $db, $table;
|
||||
|
||||
if (! empty($_REQUEST['editor_process_add'])
|
||||
|| ! empty($_REQUEST['editor_process_edit'])
|
||||
if (! empty($_POST['editor_process_add'])
|
||||
|| ! empty($_POST['editor_process_edit'])
|
||||
) {
|
||||
$sql_query = '';
|
||||
|
||||
@ -86,9 +86,9 @@ class Triggers
|
||||
|
||||
if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest()
|
||||
// Execute the created query
|
||||
if (! empty($_REQUEST['editor_process_edit'])) {
|
||||
if (! empty($_POST['editor_process_edit'])) {
|
||||
// Backup the old trigger, in case something goes wrong
|
||||
$trigger = self::getDataFromName($_REQUEST['item_original_name']);
|
||||
$trigger = self::getDataFromName($_POST['item_original_name']);
|
||||
$create_item = $trigger['create'];
|
||||
$drop_item = $trigger['drop'] . ';';
|
||||
$result = $GLOBALS['dbi']->tryQuery($drop_item);
|
||||
@ -125,7 +125,7 @@ class Triggers
|
||||
__('Trigger %1$s has been modified.')
|
||||
);
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
$sql_query = $drop_item . $item_query;
|
||||
}
|
||||
@ -145,7 +145,7 @@ class Triggers
|
||||
__('Trigger %1$s has been created.')
|
||||
);
|
||||
$message->addParam(
|
||||
Util::backquote($_REQUEST['item_name'])
|
||||
Util::backquote($_POST['item_name'])
|
||||
);
|
||||
$sql_query = $item_query;
|
||||
}
|
||||
@ -174,7 +174,7 @@ class Triggers
|
||||
$items = $GLOBALS['dbi']->getTriggers($db, $table, '');
|
||||
$trigger = false;
|
||||
foreach ($items as $value) {
|
||||
if ($value['name'] == $_REQUEST['item_name']) {
|
||||
if ($value['name'] == $_POST['item_name']) {
|
||||
$trigger = $value;
|
||||
}
|
||||
}
|
||||
@ -188,7 +188,7 @@ class Triggers
|
||||
'name',
|
||||
htmlspecialchars(
|
||||
mb_strtoupper(
|
||||
$_REQUEST['item_name']
|
||||
$_POST['item_name']
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -207,8 +207,8 @@ class Triggers
|
||||
* Display a form used to add/edit a trigger, if necessary
|
||||
*/
|
||||
if (count($errors)
|
||||
|| (empty($_REQUEST['editor_process_add'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
|| (empty($_POST['editor_process_add'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
&& (! empty($_REQUEST['add_item'])
|
||||
|| ! empty($_REQUEST['edit_item']))) // FIXME: this must be simpler than that
|
||||
) {
|
||||
@ -220,7 +220,7 @@ class Triggers
|
||||
} elseif (! empty($_REQUEST['edit_item'])) {
|
||||
$title = __("Edit trigger");
|
||||
if (! empty($_REQUEST['item_name'])
|
||||
&& empty($_REQUEST['editor_process_edit'])
|
||||
&& empty($_POST['editor_process_edit'])
|
||||
) {
|
||||
$item = self::getDataFromName($_REQUEST['item_name']);
|
||||
if ($item !== false) {
|
||||
@ -251,7 +251,7 @@ class Triggers
|
||||
'item_definition',
|
||||
'item_definer');
|
||||
foreach ($indices as $index) {
|
||||
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
|
||||
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
|
||||
}
|
||||
return $retval;
|
||||
} // end self::getDataFromRequest()
|
||||
@ -428,10 +428,10 @@ class Triggers
|
||||
global $_REQUEST, $db, $errors, $action_timings, $event_manipulations;
|
||||
|
||||
$query = 'CREATE ';
|
||||
if (! empty($_REQUEST['item_definer'])) {
|
||||
if (mb_strpos($_REQUEST['item_definer'], '@') !== false
|
||||
if (! empty($_POST['item_definer'])) {
|
||||
if (mb_strpos($_POST['item_definer'], '@') !== false
|
||||
) {
|
||||
$arr = explode('@', $_REQUEST['item_definer']);
|
||||
$arr = explode('@', $_POST['item_definer']);
|
||||
$query .= 'DEFINER=' . Util::backquote($arr[0]);
|
||||
$query .= '@' . Util::backquote($arr[1]) . ' ';
|
||||
} else {
|
||||
@ -439,36 +439,36 @@ class Triggers
|
||||
}
|
||||
}
|
||||
$query .= 'TRIGGER ';
|
||||
if (! empty($_REQUEST['item_name'])) {
|
||||
$query .= Util::backquote($_REQUEST['item_name']) . ' ';
|
||||
if (! empty($_POST['item_name'])) {
|
||||
$query .= Util::backquote($_POST['item_name']) . ' ';
|
||||
} else {
|
||||
$errors[] = __('You must provide a trigger name!');
|
||||
}
|
||||
if (! empty($_REQUEST['item_timing'])
|
||||
&& in_array($_REQUEST['item_timing'], $action_timings)
|
||||
if (! empty($_POST['item_timing'])
|
||||
&& in_array($_POST['item_timing'], $action_timings)
|
||||
) {
|
||||
$query .= $_REQUEST['item_timing'] . ' ';
|
||||
$query .= $_POST['item_timing'] . ' ';
|
||||
} else {
|
||||
$errors[] = __('You must provide a valid timing for the trigger!');
|
||||
}
|
||||
if (! empty($_REQUEST['item_event'])
|
||||
&& in_array($_REQUEST['item_event'], $event_manipulations)
|
||||
if (! empty($_POST['item_event'])
|
||||
&& in_array($_POST['item_event'], $event_manipulations)
|
||||
) {
|
||||
$query .= $_REQUEST['item_event'] . ' ';
|
||||
$query .= $_POST['item_event'] . ' ';
|
||||
} else {
|
||||
$errors[] = __('You must provide a valid event for the trigger!');
|
||||
}
|
||||
$query .= 'ON ';
|
||||
if (! empty($_REQUEST['item_table'])
|
||||
&& in_array($_REQUEST['item_table'], $GLOBALS['dbi']->getTables($db))
|
||||
if (! empty($_POST['item_table'])
|
||||
&& in_array($_POST['item_table'], $GLOBALS['dbi']->getTables($db))
|
||||
) {
|
||||
$query .= Util::backquote($_REQUEST['item_table']);
|
||||
$query .= Util::backquote($_POST['item_table']);
|
||||
} else {
|
||||
$errors[] = __('You must provide a valid table name!');
|
||||
}
|
||||
$query .= ' FOR EACH ROW ';
|
||||
if (! empty($_REQUEST['item_definition'])) {
|
||||
$query .= $_REQUEST['item_definition'];
|
||||
if (! empty($_POST['item_definition'])) {
|
||||
$query .= $_POST['item_definition'];
|
||||
} else {
|
||||
$errors[] = __('You must provide a trigger definition.');
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ class Privileges
|
||||
public static function getHtmlForUserGroupDialog($username, $is_menuswork)
|
||||
{
|
||||
$html = '';
|
||||
if (! empty($_REQUEST['edit_user_group_dialog']) && $is_menuswork) {
|
||||
if (! empty($_GET['edit_user_group_dialog']) && $is_menuswork) {
|
||||
$dialog = self::getHtmlToChooseUserGroup($username);
|
||||
$response = Response::getInstance();
|
||||
if ($response->isAjax()) {
|
||||
@ -1868,7 +1868,7 @@ class Privileges
|
||||
// similar logic in user_password.php
|
||||
$message = '';
|
||||
|
||||
if (empty($_REQUEST['nopass'])
|
||||
if (empty($_POST['nopass'])
|
||||
&& isset($_POST['pma_pw'])
|
||||
&& isset($_POST['pma_pw2'])
|
||||
) {
|
||||
@ -1885,8 +1885,8 @@ class Privileges
|
||||
$serverType = Util::getServerType();
|
||||
$serverVersion = $GLOBALS['dbi']->getVersion();
|
||||
$authentication_plugin
|
||||
= (isset($_REQUEST['authentication_plugin'])
|
||||
? $_REQUEST['authentication_plugin']
|
||||
= (isset($_POST['authentication_plugin'])
|
||||
? $_POST['authentication_plugin']
|
||||
: self::getCurrentAuthenticationPlugin(
|
||||
'change',
|
||||
$username,
|
||||
@ -2146,7 +2146,7 @@ class Privileges
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for addUsersForm, This function call if isset($_REQUEST['adduser'])
|
||||
* Get HTML for addUsersForm, This function call if isset($_GET['adduser'])
|
||||
*
|
||||
* @param string $dbname database name
|
||||
*
|
||||
@ -2825,9 +2825,13 @@ class Privileges
|
||||
break;
|
||||
}
|
||||
|
||||
$html .= ' href="server_privileges.php'
|
||||
. Url::getCommon($params)
|
||||
. '">';
|
||||
$html .= ' href="server_privileges.php';
|
||||
if ($linktype == 'revoke') {
|
||||
$html .= '" data-post="' . Url::getCommon($params, '');
|
||||
} else {
|
||||
$html .= Url::getCommon($params);
|
||||
}
|
||||
$html .= '">';
|
||||
|
||||
switch($linktype) {
|
||||
case 'edit':
|
||||
@ -2949,7 +2953,7 @@ class Privileges
|
||||
$extra_data['sql_query'] = Util::getMessage(null, $sql_query);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['change_copy'])) {
|
||||
if (isset($_POST['change_copy'])) {
|
||||
/**
|
||||
* generate html on the fly for the new user that was just created.
|
||||
*/
|
||||
@ -2961,7 +2965,7 @@ class Privileges
|
||||
. '&#27;' . htmlspecialchars($hostname) . '" />'
|
||||
. '</td>' . "\n"
|
||||
. '<td><label for="checkbox_sel_users_">'
|
||||
. (empty($_REQUEST['username'])
|
||||
. (empty($_POST['username'])
|
||||
? '<span style="color: #FF0000">' . __('Any') . '</span>'
|
||||
: htmlspecialchars($username) ) . '</label></td>' . "\n"
|
||||
. '<td>' . htmlspecialchars($hostname) . '</td>' . "\n";
|
||||
@ -3050,9 +3054,9 @@ class Privileges
|
||||
$extra_data['new_privileges'] = $new_privileges;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['validate_username'])) {
|
||||
if (isset($_GET['validate_username'])) {
|
||||
$sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '"
|
||||
. $_REQUEST['username'] . "';";
|
||||
. $_GET['username'] . "';";
|
||||
$res = $GLOBALS['dbi']->query($sql_query);
|
||||
$row = $GLOBALS['dbi']->fetchRow($res);
|
||||
if (empty($row)) {
|
||||
@ -3362,7 +3366,7 @@ class Privileges
|
||||
|
||||
$foundRows = array();
|
||||
$privileges = array();
|
||||
foreach ($db_rights as $row) {
|
||||
foreach ($db_rights as $row) {error_log(print_r($row, true));
|
||||
$onePrivilege = array();
|
||||
|
||||
$paramTableName = '';
|
||||
@ -3776,7 +3780,7 @@ class Privileges
|
||||
->render(
|
||||
array(
|
||||
'array_initials' => $array_initials,
|
||||
'initial' => isset($_REQUEST['initial']) ? $_REQUEST['initial'] : null,
|
||||
'initial' => isset($_GET['initial']) ? $_GET['initial'] : null,
|
||||
)
|
||||
);
|
||||
|
||||
@ -3847,7 +3851,7 @@ class Privileges
|
||||
if (empty($queries)) {
|
||||
$message = Message::error(__('No users selected for deleting!'));
|
||||
} else {
|
||||
if ($_REQUEST['mode'] == 3) {
|
||||
if ($_POST['mode'] == 3) {
|
||||
$queries[] = '# ' . __('Reloading the privileges') . ' …';
|
||||
$queries[] = 'FLUSH PRIVILEGES;';
|
||||
}
|
||||
@ -3958,11 +3962,11 @@ class Privileges
|
||||
$queries = null;
|
||||
$password = null;
|
||||
|
||||
if (isset($_REQUEST['change_copy'])) {
|
||||
if (isset($_POST['change_copy'])) {
|
||||
$user_host_condition = ' WHERE `User` = '
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'"
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'"
|
||||
. ' AND `Host` = '
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['old_hostname']) . "';";
|
||||
. "'" . $GLOBALS['dbi']->escapeString($_POST['old_hostname']) . "';";
|
||||
$row = $GLOBALS['dbi']->fetchSingleRow(
|
||||
'SELECT * FROM `mysql`.`user` ' . $user_host_condition
|
||||
);
|
||||
@ -3971,7 +3975,7 @@ class Privileges
|
||||
$response->addHTML(
|
||||
Message::notice(__('No user found.'))->getDisplay()
|
||||
);
|
||||
unset($_REQUEST['change_copy']);
|
||||
unset($_POST['change_copy']);
|
||||
} else {
|
||||
extract($row, EXTR_OVERWRITE);
|
||||
foreach ($row as $key => $value) {
|
||||
@ -4029,12 +4033,12 @@ class Privileges
|
||||
*/
|
||||
public static function getDataForDeleteUsers($queries)
|
||||
{
|
||||
if (isset($_REQUEST['change_copy'])) {
|
||||
if (isset($_POST['change_copy'])) {
|
||||
$selected_usr = array(
|
||||
$_REQUEST['old_username'] . '&#27;' . $_REQUEST['old_hostname']
|
||||
$_POST['old_username'] . '&#27;' . $_POST['old_hostname']
|
||||
);
|
||||
} else {
|
||||
$selected_usr = $_REQUEST['selected_usr'];
|
||||
$selected_usr = $_POST['selected_usr'];
|
||||
$queries = array();
|
||||
}
|
||||
|
||||
@ -4056,7 +4060,7 @@ class Privileges
|
||||
. '\'@\'' . $GLOBALS['dbi']->escapeString($this_host) . '\';';
|
||||
RelationCleanup::user($this_user);
|
||||
|
||||
if (isset($_REQUEST['drop_users_db'])) {
|
||||
if (isset($_POST['drop_users_db'])) {
|
||||
$queries[] = 'DROP DATABASE IF EXISTS '
|
||||
. Util::backquote($this_user) . ';';
|
||||
$GLOBALS['reload'] = true;
|
||||
@ -4073,7 +4077,7 @@ class Privileges
|
||||
public static function updateMessageForReload()
|
||||
{
|
||||
$message = null;
|
||||
if (isset($_REQUEST['flush_privileges'])) {
|
||||
if (isset($_GET['flush_privileges'])) {
|
||||
$sql_query = 'FLUSH PRIVILEGES;';
|
||||
$GLOBALS['dbi']->query($sql_query);
|
||||
$message = Message::success(
|
||||
@ -4081,7 +4085,7 @@ class Privileges
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['validate_username'])) {
|
||||
if (isset($_GET['validate_username'])) {
|
||||
$message = Message::success();
|
||||
}
|
||||
|
||||
@ -4135,7 +4139,7 @@ class Privileges
|
||||
$queries_for_display = null;
|
||||
$sql_query = null;
|
||||
|
||||
if (!isset($_REQUEST['adduser_submit']) && !isset($_REQUEST['change_copy'])) {
|
||||
if (!isset($_POST['adduser_submit']) && !isset($_POST['change_copy'])) {
|
||||
return array(
|
||||
$message, $queries, $queries_for_display, $sql_query, $_add_user_error
|
||||
);
|
||||
@ -4170,7 +4174,7 @@ class Privileges
|
||||
if ($GLOBALS['dbi']->fetchValue($sql) == 1) {
|
||||
$message = Message::error(__('The user %s already exists!'));
|
||||
$message->addParam('[em]\'' . $username . '\'@\'' . $hostname . '\'[/em]');
|
||||
$_REQUEST['adduser'] = true;
|
||||
$_GET['adduser'] = true;
|
||||
$_add_user_error = true;
|
||||
|
||||
return array(
|
||||
@ -4189,7 +4193,7 @@ class Privileges
|
||||
$username, $hostname, (isset($password) ? $password : '')
|
||||
);
|
||||
|
||||
if (empty($_REQUEST['change_copy'])) {
|
||||
if (empty($_POST['change_copy'])) {
|
||||
$_error = false;
|
||||
|
||||
if (isset($create_user_real)) {
|
||||
@ -4197,10 +4201,10 @@ class Privileges
|
||||
$_error = true;
|
||||
}
|
||||
if (isset($password_set_real) && !empty($password_set_real)
|
||||
&& isset($_REQUEST['authentication_plugin'])
|
||||
&& isset($_POST['authentication_plugin'])
|
||||
) {
|
||||
self::setProperPasswordHashing(
|
||||
$_REQUEST['authentication_plugin']
|
||||
$_POST['authentication_plugin']
|
||||
);
|
||||
if ($GLOBALS['dbi']->tryQuery($password_set_real)) {
|
||||
$sql_query .= $password_set_show;
|
||||
@ -4217,8 +4221,8 @@ class Privileges
|
||||
$hostname,
|
||||
isset($dbname) ? $dbname : null
|
||||
);
|
||||
if (!empty($_REQUEST['userGroup']) && $is_menuwork) {
|
||||
self::setUserGroup($GLOBALS['username'], $_REQUEST['userGroup']);
|
||||
if (!empty($_POST['userGroup']) && $is_menuwork) {
|
||||
self::setUserGroup($GLOBALS['username'], $_POST['userGroup']);
|
||||
}
|
||||
|
||||
return array(
|
||||
@ -4232,8 +4236,8 @@ class Privileges
|
||||
|
||||
// Copy the user group while copying a user
|
||||
$old_usergroup =
|
||||
isset($_REQUEST['old_usergroup']) ? $_REQUEST['old_usergroup'] : null;
|
||||
self::setUserGroup($_REQUEST['username'], $old_usergroup);
|
||||
isset($_POST['old_usergroup']) ? $_POST['old_usergroup'] : null;
|
||||
self::setUserGroup($_POST['username'], $old_usergroup);
|
||||
|
||||
if (isset($create_user_real)) {
|
||||
$queries[] = $create_user_real;
|
||||
@ -4241,10 +4245,10 @@ class Privileges
|
||||
$queries[] = $real_sql_query;
|
||||
|
||||
if (isset($password_set_real) && ! empty($password_set_real)
|
||||
&& isset($_REQUEST['authentication_plugin'])
|
||||
&& isset($_POST['authentication_plugin'])
|
||||
) {
|
||||
self::setProperPasswordHashing(
|
||||
$_REQUEST['authentication_plugin']
|
||||
$_POST['authentication_plugin']
|
||||
);
|
||||
|
||||
$queries[] = $password_set_real;
|
||||
@ -4313,25 +4317,25 @@ class Privileges
|
||||
/**
|
||||
* Checks if a dropdown box has been used for selecting a database / table
|
||||
*/
|
||||
if (Core::isValid($_REQUEST['pred_tablename'])) {
|
||||
$tablename = $_REQUEST['pred_tablename'];
|
||||
if (Core::isValid($_POST['pred_tablename'])) {
|
||||
$tablename = $_POST['pred_tablename'];
|
||||
} elseif (Core::isValid($_REQUEST['tablename'])) {
|
||||
$tablename = $_REQUEST['tablename'];
|
||||
} else {
|
||||
unset($tablename);
|
||||
}
|
||||
|
||||
if (Core::isValid($_REQUEST['pred_routinename'])) {
|
||||
$routinename = $_REQUEST['pred_routinename'];
|
||||
if (Core::isValid($_POST['pred_routinename'])) {
|
||||
$routinename = $_POST['pred_routinename'];
|
||||
} elseif (Core::isValid($_REQUEST['routinename'])) {
|
||||
$routinename = $_REQUEST['routinename'];
|
||||
} else {
|
||||
unset($routinename);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['pred_dbname'])) {
|
||||
if (isset($_POST['pred_dbname'])) {
|
||||
$is_valid_pred_dbname = true;
|
||||
foreach ($_REQUEST['pred_dbname'] as $key => $db_name) {
|
||||
foreach ($_POST['pred_dbname'] as $key => $db_name) {
|
||||
if (! Core::isValid($db_name)) {
|
||||
$is_valid_pred_dbname = false;
|
||||
break;
|
||||
@ -4356,7 +4360,7 @@ class Privileges
|
||||
}
|
||||
|
||||
if (isset($is_valid_pred_dbname) && $is_valid_pred_dbname) {
|
||||
$dbname = $_REQUEST['pred_dbname'];
|
||||
$dbname = $_POST['pred_dbname'];
|
||||
// If dbname contains only one database.
|
||||
if (count($dbname) == 1) {
|
||||
$dbname = $dbname[0];
|
||||
@ -4425,14 +4429,14 @@ class Privileges
|
||||
{
|
||||
$export = '<textarea class="export" cols="60" rows="15">';
|
||||
|
||||
if (isset($_REQUEST['selected_usr'])) {
|
||||
if (isset($_POST['selected_usr'])) {
|
||||
// export privileges for selected users
|
||||
$title = __('Privileges');
|
||||
|
||||
//For removing duplicate entries of users
|
||||
$_REQUEST['selected_usr'] = array_unique($_REQUEST['selected_usr']);
|
||||
$_POST['selected_usr'] = array_unique($_POST['selected_usr']);
|
||||
|
||||
foreach ($_REQUEST['selected_usr'] as $export_user) {
|
||||
foreach ($_POST['selected_usr'] as $export_user) {
|
||||
$export_username = mb_substr(
|
||||
$export_user, 0, mb_strpos($export_user, '&')
|
||||
);
|
||||
@ -4631,8 +4635,8 @@ class Privileges
|
||||
" IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" .
|
||||
' FROM `mysql`.`user`';
|
||||
|
||||
$sql_query .= (isset($_REQUEST['initial'])
|
||||
? self::rangeOfUsers($_REQUEST['initial'])
|
||||
$sql_query .= (isset($_GET['initial'])
|
||||
? self::rangeOfUsers($_GET['initial'])
|
||||
: '');
|
||||
|
||||
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
|
||||
@ -4712,8 +4716,8 @@ class Privileges
|
||||
* Display the user overview
|
||||
* (if less than 50 users, display them immediately)
|
||||
*/
|
||||
if (isset($_REQUEST['initial'])
|
||||
|| isset($_REQUEST['showall'])
|
||||
if (isset($_GET['initial'])
|
||||
|| isset($_GET['showall'])
|
||||
|| $GLOBALS['dbi']->numRows($res) < 50
|
||||
) {
|
||||
$html_output .= self::getUsersOverview(
|
||||
@ -4895,9 +4899,9 @@ class Privileges
|
||||
'SELECT `Column_name`, `Column_priv`'
|
||||
. ' FROM `mysql`.`columns_priv`'
|
||||
. ' WHERE `User`'
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'"
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'"
|
||||
. ' AND `Host`'
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . '\''
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . '\''
|
||||
. ' AND `Db`'
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($row['Db']) . "'"
|
||||
. ' AND `Table_name`'
|
||||
@ -4971,9 +4975,9 @@ class Privileges
|
||||
array $queries, $username, $hostname
|
||||
) {
|
||||
$user_host_condition = ' WHERE `User`'
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_username']) . "'"
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'"
|
||||
. ' AND `Host`'
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['old_hostname']) . '\';';
|
||||
. ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_hostname']) . '\';';
|
||||
|
||||
$res = $GLOBALS['dbi']->query(
|
||||
'SELECT * FROM `mysql`.`db`' . $user_host_condition
|
||||
@ -5014,14 +5018,14 @@ class Privileges
|
||||
if ($_error || (!empty($real_sql_query)
|
||||
&& !$GLOBALS['dbi']->tryQuery($real_sql_query))
|
||||
) {
|
||||
$_REQUEST['createdb-1'] = $_REQUEST['createdb-2']
|
||||
= $_REQUEST['createdb-3'] = null;
|
||||
$_POST['createdb-1'] = $_POST['createdb-2']
|
||||
= $_POST['createdb-3'] = null;
|
||||
$message = Message::rawError($GLOBALS['dbi']->getError());
|
||||
} else {
|
||||
$message = Message::success(__('You have added a new user.'));
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['createdb-1'])) {
|
||||
if (isset($_POST['createdb-1'])) {
|
||||
// Create database with same name and grant all privileges
|
||||
$q = 'CREATE DATABASE IF NOT EXISTS '
|
||||
. Util::backquote(
|
||||
@ -5052,7 +5056,7 @@ class Privileges
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['createdb-2'])) {
|
||||
if (isset($_POST['createdb-2'])) {
|
||||
// Grant all privileges on wildcard name (username\_%)
|
||||
$q = 'GRANT ALL PRIVILEGES ON '
|
||||
. Util::backquote(
|
||||
@ -5068,7 +5072,7 @@ class Privileges
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['createdb-3'])) {
|
||||
if (isset($_POST['createdb-3'])) {
|
||||
// Grant all privileges on the specified database to the new user
|
||||
$q = 'GRANT ALL PRIVILEGES ON '
|
||||
. Util::backquote(
|
||||
@ -5166,21 +5170,21 @@ class Privileges
|
||||
// is supported by MySQL 5.5.7+
|
||||
if (($serverType == 'MySQL' || $serverType == 'Percona Server')
|
||||
&& $serverVersion >= 50507
|
||||
&& isset($_REQUEST['authentication_plugin'])
|
||||
&& isset($_POST['authentication_plugin'])
|
||||
) {
|
||||
$create_user_stmt .= ' IDENTIFIED WITH '
|
||||
. $_REQUEST['authentication_plugin'];
|
||||
. $_POST['authentication_plugin'];
|
||||
}
|
||||
|
||||
// 'IDENTIFIED VIA auth_plugin'
|
||||
// is supported by MariaDB 5.2+
|
||||
if ($serverType == 'MariaDB'
|
||||
&& $serverVersion >= 50200
|
||||
&& isset($_REQUEST['authentication_plugin'])
|
||||
&& isset($_POST['authentication_plugin'])
|
||||
&& ! $isMariaDBPwdPluginActive
|
||||
) {
|
||||
$create_user_stmt .= ' IDENTIFIED VIA '
|
||||
. $_REQUEST['authentication_plugin'];
|
||||
. $_POST['authentication_plugin'];
|
||||
}
|
||||
|
||||
$create_user_real = $create_user_show = $create_user_stmt;
|
||||
@ -5202,9 +5206,9 @@ class Privileges
|
||||
$real_sql_query = $sql_query = $sql_query_stmt;
|
||||
|
||||
// Set the proper hashing method
|
||||
if (isset($_REQUEST['authentication_plugin'])) {
|
||||
if (isset($_POST['authentication_plugin'])) {
|
||||
self::setProperPasswordHashing(
|
||||
$_REQUEST['authentication_plugin']
|
||||
$_POST['authentication_plugin']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -143,43 +143,44 @@ class Data
|
||||
$links = array();
|
||||
// variable or section name => (name => url)
|
||||
|
||||
$links['table'][__('Flush (close) all tables')] = $this->selfUrl
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'flush' => 'TABLES'
|
||||
)
|
||||
);
|
||||
$links['table'][__('Show open tables')]
|
||||
= 'sql.php' . Url::getCommon(
|
||||
array(
|
||||
'sql_query' => 'SHOW OPEN TABLES',
|
||||
'goto' => $this->selfUrl,
|
||||
)
|
||||
);
|
||||
$links['table'][__('Flush (close) all tables')] = [
|
||||
'url' => $this->selfUrl,
|
||||
'params' => Url::getCommon(['flush' => 'TABLES'], ''),
|
||||
];
|
||||
$links['table'][__('Show open tables')] = [
|
||||
'url' => 'sql.php',
|
||||
'params' => Url::getCommon([
|
||||
'sql_query' => 'SHOW OPEN TABLES',
|
||||
'goto' => $this->selfUrl,
|
||||
], ''),
|
||||
];
|
||||
|
||||
if ($GLOBALS['replication_info']['master']['status']) {
|
||||
$links['repl'][__('Show slave hosts')]
|
||||
= 'sql.php' . Url::getCommon(
|
||||
array(
|
||||
'sql_query' => 'SHOW SLAVE HOSTS',
|
||||
'goto' => $this->selfUrl,
|
||||
)
|
||||
);
|
||||
$links['repl'][__('Show master status')] = '#replication_master';
|
||||
$links['repl'][__('Show slave hosts')] = [
|
||||
'url' => 'sql.php',
|
||||
'params' => Url::getCommon([
|
||||
'sql_query' => 'SHOW SLAVE HOSTS',
|
||||
'goto' => $this->selfUrl,
|
||||
], ''),
|
||||
];
|
||||
$links['repl'][__('Show master status')] = [
|
||||
'url' => '#replication_master',
|
||||
'params' => '',
|
||||
];
|
||||
}
|
||||
if ($GLOBALS['replication_info']['slave']['status']) {
|
||||
$links['repl'][__('Show slave status')] = '#replication_slave';
|
||||
$links['repl'][__('Show slave status')] = [
|
||||
'url' => '#replication_slave',
|
||||
'params' => '',
|
||||
];
|
||||
}
|
||||
|
||||
$links['repl']['doc'] = 'replication';
|
||||
|
||||
$links['qcache'][__('Flush query cache')]
|
||||
= $this->selfUrl
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'flush' => 'QUERY CACHE'
|
||||
)
|
||||
);
|
||||
$links['qcache'][__('Flush query cache')] = [
|
||||
'url' => $this->selfUrl,
|
||||
'params' => Url::getCommon(['flush' => 'QUERY CACHE'], ''),
|
||||
];
|
||||
$links['qcache']['doc'] = 'query_cache';
|
||||
|
||||
$links['threads']['doc'] = 'mysql_threads';
|
||||
@ -190,16 +191,17 @@ class Data
|
||||
|
||||
$links['Slow_queries']['doc'] = 'slow_query_log';
|
||||
|
||||
$links['innodb'][__('Variables')]
|
||||
= 'server_engines.php?' . Url::getCommon(array('engine' => 'InnoDB'));
|
||||
$links['innodb'][__('InnoDB Status')]
|
||||
= 'server_engines.php'
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'engine' => 'InnoDB',
|
||||
'page' => 'Status'
|
||||
)
|
||||
);
|
||||
$links['innodb'][__('Variables')] = [
|
||||
'url' => 'server_engines.php',
|
||||
'params' => Url::getCommon(['engine' => 'InnoDB'], ''),
|
||||
];
|
||||
$links['innodb'][__('InnoDB Status')] = [
|
||||
'url' => 'server_engines.php',
|
||||
'params' => Url::getCommon([
|
||||
'engine' => 'InnoDB',
|
||||
'page' => 'Status',
|
||||
], ''),
|
||||
];
|
||||
$links['innodb']['doc'] = 'innodb';
|
||||
|
||||
return($links);
|
||||
|
||||
@ -379,7 +379,7 @@ class Monitor
|
||||
*/
|
||||
public static function getJsonForChartingData()
|
||||
{
|
||||
$ret = json_decode($_REQUEST['requiredData'], true);
|
||||
$ret = json_decode($_POST['requiredData'], true);
|
||||
$statusVars = array();
|
||||
$serverVars = array();
|
||||
$sysinfo = $cpuload = $memory = 0;
|
||||
@ -633,7 +633,7 @@ class Monitor
|
||||
public static function getJsonForLogDataTypeGeneral($start, $end)
|
||||
{
|
||||
$limitTypes = '';
|
||||
if (isset($_REQUEST['limitTypes']) && $_REQUEST['limitTypes']) {
|
||||
if (isset($_POST['limitTypes']) && $_POST['limitTypes']) {
|
||||
$limitTypes
|
||||
= 'AND argument REGEXP \'^(INSERT|SELECT|UPDATE|DELETE)\' ';
|
||||
}
|
||||
@ -652,8 +652,8 @@ class Monitor
|
||||
$insertTables = array();
|
||||
$insertTablesFirst = -1;
|
||||
$i = 0;
|
||||
$removeVars = isset($_REQUEST['removeVariables'])
|
||||
&& $_REQUEST['removeVariables'];
|
||||
$removeVars = isset($_POST['removeVariables'])
|
||||
&& $_POST['removeVariables'];
|
||||
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
preg_match('/^(\w+)\s/', $row['argument'], $match);
|
||||
@ -753,15 +753,15 @@ class Monitor
|
||||
*/
|
||||
public static function getJsonForLoggingVars()
|
||||
{
|
||||
if (isset($_REQUEST['varName']) && isset($_REQUEST['varValue'])) {
|
||||
$value = $GLOBALS['dbi']->escapeString($_REQUEST['varValue']);
|
||||
if (isset($_POST['varName']) && isset($_POST['varValue'])) {
|
||||
$value = $GLOBALS['dbi']->escapeString($_POST['varValue']);
|
||||
if (! is_numeric($value)) {
|
||||
$value="'" . $value . "'";
|
||||
}
|
||||
|
||||
if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])) {
|
||||
if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName'])) {
|
||||
$GLOBALS['dbi']->query(
|
||||
'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value
|
||||
'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value
|
||||
);
|
||||
}
|
||||
|
||||
@ -785,8 +785,8 @@ class Monitor
|
||||
{
|
||||
$return = array();
|
||||
|
||||
if (strlen($_REQUEST['database']) > 0) {
|
||||
$GLOBALS['dbi']->selectDb($_REQUEST['database']);
|
||||
if (strlen($_POST['database']) > 0) {
|
||||
$GLOBALS['dbi']->selectDb($_POST['database']);
|
||||
}
|
||||
|
||||
if ($profiling = Util::profilingSupported()) {
|
||||
@ -797,7 +797,7 @@ class Monitor
|
||||
$query = preg_replace(
|
||||
'/^(\s*SELECT)/i',
|
||||
'\\1 SQL_NO_CACHE',
|
||||
$_REQUEST['query']
|
||||
$_POST['query']
|
||||
);
|
||||
|
||||
$GLOBALS['dbi']->tryQuery($query);
|
||||
|
||||
@ -58,7 +58,7 @@ class Processes
|
||||
{
|
||||
$url_params = array();
|
||||
|
||||
$show_full_sql = ! empty($_REQUEST['full']);
|
||||
$show_full_sql = ! empty($_POST['full']);
|
||||
if ($show_full_sql) {
|
||||
$url_params['full'] = 1;
|
||||
$full_text_link = 'server_status_processes.php' . Url::getCommon(
|
||||
@ -115,19 +115,19 @@ class Processes
|
||||
$sql_query = $show_full_sql
|
||||
? 'SHOW FULL PROCESSLIST'
|
||||
: 'SHOW PROCESSLIST';
|
||||
if ((! empty($_REQUEST['order_by_field'])
|
||||
&& ! empty($_REQUEST['sort_order']))
|
||||
|| (! empty($_REQUEST['showExecuting']))
|
||||
if ((! empty($_POST['order_by_field'])
|
||||
&& ! empty($_POST['sort_order']))
|
||||
|| (! empty($_POST['showExecuting']))
|
||||
) {
|
||||
$sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ';
|
||||
}
|
||||
if (! empty($_REQUEST['showExecuting'])) {
|
||||
if (! empty($_POST['showExecuting'])) {
|
||||
$sql_query .= ' WHERE state != "" ';
|
||||
}
|
||||
if (!empty($_REQUEST['order_by_field']) && !empty($_REQUEST['sort_order'])) {
|
||||
if (!empty($_POST['order_by_field']) && !empty($_POST['sort_order'])) {
|
||||
$sql_query .= ' ORDER BY '
|
||||
. Util::backquote($_REQUEST['order_by_field'])
|
||||
. ' ' . $_REQUEST['sort_order'];
|
||||
. Util::backquote($_POST['order_by_field'])
|
||||
. ' ' . $_POST['sort_order'];
|
||||
}
|
||||
|
||||
$result = $GLOBALS['dbi']->query($sql_query);
|
||||
@ -140,15 +140,15 @@ class Processes
|
||||
$retval .= '<th>' . __('Processes') . '</th>';
|
||||
foreach ($sortable_columns as $column) {
|
||||
|
||||
$is_sorted = ! empty($_REQUEST['order_by_field'])
|
||||
&& ! empty($_REQUEST['sort_order'])
|
||||
&& ($_REQUEST['order_by_field'] == $column['order_by_field']);
|
||||
$is_sorted = ! empty($_POST['order_by_field'])
|
||||
&& ! empty($_POST['sort_order'])
|
||||
&& ($_POST['order_by_field'] == $column['order_by_field']);
|
||||
|
||||
$column['sort_order'] = 'ASC';
|
||||
if ($is_sorted && $_REQUEST['sort_order'] === 'ASC') {
|
||||
if ($is_sorted && $_POST['sort_order'] === 'ASC') {
|
||||
$column['sort_order'] = 'DESC';
|
||||
}
|
||||
if (isset($_REQUEST['showExecuting'])) {
|
||||
if (isset($_POST['showExecuting'])) {
|
||||
$column['showExecuting'] = 'on';
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ class Processes
|
||||
if ($is_sorted) {
|
||||
$asc_display_style = 'inline';
|
||||
$desc_display_style = 'none';
|
||||
if ($_REQUEST['sort_order'] === 'DESC') {
|
||||
if ($_POST['sort_order'] === 'DESC') {
|
||||
$desc_display_style = 'inline';
|
||||
$asc_display_style = 'none';
|
||||
}
|
||||
@ -214,23 +214,23 @@ class Processes
|
||||
public static function getHtmlForProcessListFilter()
|
||||
{
|
||||
$showExecuting = '';
|
||||
if (! empty($_REQUEST['showExecuting'])) {
|
||||
if (! empty($_POST['showExecuting'])) {
|
||||
$showExecuting = ' checked="checked"';
|
||||
}
|
||||
|
||||
$url_params = array(
|
||||
'ajax_request' => true,
|
||||
'full' => (isset($_REQUEST['full']) ? $_REQUEST['full'] : ''),
|
||||
'column_name' => (isset($_REQUEST['column_name']) ? $_REQUEST['column_name'] : ''),
|
||||
'full' => (isset($_POST['full']) ? $_POST['full'] : ''),
|
||||
'column_name' => (isset($_POST['column_name']) ? $_POST['column_name'] : ''),
|
||||
'order_by_field'
|
||||
=> (isset($_REQUEST['order_by_field']) ? $_REQUEST['order_by_field'] : ''),
|
||||
'sort_order' => (isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : ''),
|
||||
=> (isset($_POST['order_by_field']) ? $_POST['order_by_field'] : ''),
|
||||
'sort_order' => (isset($_POST['sort_order']) ? $_POST['sort_order'] : ''),
|
||||
);
|
||||
|
||||
$retval = '';
|
||||
$retval .= '<fieldset id="tableFilter">';
|
||||
$retval .= '<legend>' . __('Filters') . '</legend>';
|
||||
$retval .= '<form action="server_status_processes.php">';
|
||||
$retval .= '<form action="server_status_processes.php" method="post">';
|
||||
$retval .= Url::getHiddenInputs($url_params);
|
||||
$retval .= '<input type="submit" value="' . __('Refresh') . '" />';
|
||||
$retval .= '<div class="formelement">';
|
||||
@ -258,8 +258,8 @@ class Processes
|
||||
{
|
||||
// Array keys need to modify due to the way it has used
|
||||
// to display column values
|
||||
if ((! empty($_REQUEST['order_by_field']) && ! empty($_REQUEST['sort_order']))
|
||||
|| (! empty($_REQUEST['showExecuting']))
|
||||
if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order']))
|
||||
|| (! empty($_POST['showExecuting']))
|
||||
) {
|
||||
foreach (array_keys($process) as $key) {
|
||||
$new_key = ucfirst(mb_strtolower($key));
|
||||
@ -270,14 +270,9 @@ class Processes
|
||||
}
|
||||
}
|
||||
|
||||
$url_params = array(
|
||||
'kill' => $process['Id'],
|
||||
'ajax_request' => true
|
||||
);
|
||||
$kill_process = 'server_status_processes.php' . Url::getCommon($url_params);
|
||||
|
||||
$retval = '<tr>';
|
||||
$retval .= '<td><a class="ajax kill_process" href="' . $kill_process . '">'
|
||||
$retval .= '<td><a class="ajax kill_process" href="server_status_processes.php"'
|
||||
. ' data-post="' . Url::getCommon(['kill' => $process['Id']], '') . '">'
|
||||
. __('Kill') . '</a></td>';
|
||||
$retval .= '<td class="value">' . $process['Id'] . '</td>';
|
||||
$retval .= '<td>' . htmlspecialchars($process['User']) . '</td>';
|
||||
|
||||
@ -30,23 +30,23 @@ class Variables
|
||||
public static function getHtmlForFilter(Data $serverStatusData)
|
||||
{
|
||||
$filterAlert = '';
|
||||
if (! empty($_REQUEST['filterAlert'])) {
|
||||
if (! empty($_POST['filterAlert'])) {
|
||||
$filterAlert = ' checked="checked"';
|
||||
}
|
||||
$filterText = '';
|
||||
if (! empty($_REQUEST['filterText'])) {
|
||||
$filterText = htmlspecialchars($_REQUEST['filterText']);
|
||||
if (! empty($_POST['filterText'])) {
|
||||
$filterText = htmlspecialchars($_POST['filterText']);
|
||||
}
|
||||
$dontFormat = '';
|
||||
if (! empty($_REQUEST['dontFormat'])) {
|
||||
if (! empty($_POST['dontFormat'])) {
|
||||
$dontFormat = ' checked="checked"';
|
||||
}
|
||||
|
||||
$retval = '';
|
||||
$retval .= '<fieldset id="tableFilter">';
|
||||
$retval .= '<legend>' . __('Filters') . '</legend>';
|
||||
$retval .= '<form action="server_status_variables.php'
|
||||
. Url::getCommon() . '">';
|
||||
$retval .= '<form action="server_status_variables.php" method="post">';
|
||||
$retval .= Url::getHiddenInputs();
|
||||
$retval .= '<input type="submit" value="' . __('Refresh') . '" />';
|
||||
$retval .= '<div class="formelement">';
|
||||
$retval .= '<label for="filterText">' . __('Containing the word:') . '</label>';
|
||||
@ -66,8 +66,8 @@ class Variables
|
||||
|
||||
foreach ($serverStatusData->sections as $section_id => $section_name) {
|
||||
if (isset($serverStatusData->sectionUsed[$section_id])) {
|
||||
if (! empty($_REQUEST['filterCategory'])
|
||||
&& $_REQUEST['filterCategory'] == $section_id
|
||||
if (! empty($_POST['filterCategory'])
|
||||
&& $_POST['filterCategory'] == $section_id
|
||||
) {
|
||||
$selected = ' selected="selected"';
|
||||
} else {
|
||||
@ -113,7 +113,8 @@ class Variables
|
||||
if ('doc' == $link_name) {
|
||||
$retval .= Util::showMySQLDocu($link_url);
|
||||
} else {
|
||||
$retval .= '<a href="' . $link_url . '">' . $link_name . '</a>';
|
||||
$retval .= '<a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
|
||||
. $link_name . '</a>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -309,7 +310,8 @@ class Variables
|
||||
if ('doc' == $link_name) {
|
||||
$retval .= Util::showMySQLDocu($link_url);
|
||||
} else {
|
||||
$retval .= ' <a href="' . $link_url . '">' . $link_name . '</a>';
|
||||
$retval .= ' <a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
|
||||
. $link_name . '</a>';
|
||||
}
|
||||
}
|
||||
unset($link_url, $link_name);
|
||||
|
||||
@ -110,31 +110,34 @@ class UserGroups
|
||||
$html_output .= '<td>' . self::getAllowedTabNames($tabs, 'table') . '</td>';
|
||||
|
||||
$html_output .= '<td>';
|
||||
$html_output .= '<a class="" href="server_user_groups.php'
|
||||
$html_output .= '<a class="" href="server_user_groups.php" data-post="'
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'viewUsers' => 1, 'userGroup' => $groupName
|
||||
)
|
||||
),
|
||||
''
|
||||
)
|
||||
. '">'
|
||||
. Util::getIcon('b_usrlist', __('View users'))
|
||||
. '</a>';
|
||||
$html_output .= ' ';
|
||||
$html_output .= '<a class="" href="server_user_groups.php'
|
||||
$html_output .= '<a class="" href="server_user_groups.php" data-post="'
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'editUserGroup' => 1, 'userGroup' => $groupName
|
||||
)
|
||||
),
|
||||
''
|
||||
)
|
||||
. '">'
|
||||
. Util::getIcon('b_edit', __('Edit')) . '</a>';
|
||||
$html_output .= ' ';
|
||||
$html_output .= '<a class="deleteUserGroup ajax"'
|
||||
. ' href="server_user_groups.php'
|
||||
. ' href="server_user_groups.php" data-post="'
|
||||
. Url::getCommon(
|
||||
array(
|
||||
'deleteUserGroup' => 1, 'userGroup' => $groupName
|
||||
)
|
||||
),
|
||||
''
|
||||
)
|
||||
. '">'
|
||||
. Util::getIcon('b_drop', __('Delete')) . '</a>';
|
||||
@ -364,7 +367,7 @@ class UserGroups
|
||||
$sql_query .= ", ";
|
||||
}
|
||||
$tabName = $tabGroupName . '_' . $tab;
|
||||
$allowed = isset($_REQUEST[$tabName]) && $_REQUEST[$tabName] == 'Y';
|
||||
$allowed = isset($_POST[$tabName]) && $_POST[$tabName] == 'Y';
|
||||
$sql_query .= "('" . $GLOBALS['dbi']->escapeString($userGroup) . "', '" . $tabName . "', '"
|
||||
. ($allowed ? "Y" : "N") . "')";
|
||||
$first = false;
|
||||
|
||||
@ -219,10 +219,10 @@ class Sql
|
||||
);
|
||||
|
||||
$dropdown = '<span class="curr_value">'
|
||||
. htmlspecialchars($_REQUEST['curr_value'])
|
||||
. htmlspecialchars($_POST['curr_value'])
|
||||
. '</span>'
|
||||
. '<a href="browse_foreigners.php'
|
||||
. Url::getCommon($_url_params) . '"'
|
||||
. '<a href="browse_foreigners.php" data-post="'
|
||||
. Url::getCommon($_url_params, '') . '"'
|
||||
. 'class="ajax browse_foreign" ' . '>'
|
||||
. __('Browse foreign values')
|
||||
. '</a>';
|
||||
@ -471,9 +471,9 @@ EOT;
|
||||
$values = $this->getValuesForColumn($db, $table, $column);
|
||||
$dropdown = '';
|
||||
$full_values =
|
||||
isset($_REQUEST['get_full_values']) ? $_REQUEST['get_full_values'] : false;
|
||||
isset($_POST['get_full_values']) ? $_POST['get_full_values'] : false;
|
||||
$where_clause =
|
||||
isset($_REQUEST['where_clause']) ? $_REQUEST['where_clause'] : null;
|
||||
isset($_POST['where_clause']) ? $_POST['where_clause'] : null;
|
||||
|
||||
// If the $curr_value was truncated, we should
|
||||
// fetch the correct full values from the table
|
||||
@ -744,7 +744,7 @@ EOT;
|
||||
*/
|
||||
private function setColumnProperty($pmatable, $request_index)
|
||||
{
|
||||
$property_value = array_map('intval', explode(',', $_REQUEST[$request_index]));
|
||||
$property_value = array_map('intval', explode(',', $_POST[$request_index]));
|
||||
switch($request_index) {
|
||||
case 'col_order':
|
||||
$property_to_set = Table::PROP_COLUMN_ORDER;
|
||||
@ -758,7 +758,7 @@ EOT;
|
||||
$retval = $pmatable->setUiProp(
|
||||
$property_to_set,
|
||||
$property_value,
|
||||
$_REQUEST['table_create_time']
|
||||
$_POST['table_create_time']
|
||||
);
|
||||
if (gettype($retval) != 'boolean') {
|
||||
$response = Response::getInstance();
|
||||
@ -784,12 +784,12 @@ EOT;
|
||||
$retval = false;
|
||||
|
||||
// set column order
|
||||
if (isset($_REQUEST['col_order'])) {
|
||||
if (isset($_POST['col_order'])) {
|
||||
$retval = $this->setColumnProperty($pmatable, 'col_order');
|
||||
}
|
||||
|
||||
// set column visibility
|
||||
if ($retval === true && isset($_REQUEST['col_visib'])) {
|
||||
if ($retval === true && isset($_POST['col_visib'])) {
|
||||
$retval = $this->setColumnProperty($pmatable, 'col_visib');
|
||||
}
|
||||
|
||||
@ -866,14 +866,14 @@ EOT;
|
||||
*/
|
||||
public function getRelationalValues($db, $table)
|
||||
{
|
||||
$column = $_REQUEST['column'];
|
||||
$column = $_POST['column'];
|
||||
if ($_SESSION['tmpval']['relational_display'] == 'D'
|
||||
&& isset($_REQUEST['relation_key_or_display_column'])
|
||||
&& $_REQUEST['relation_key_or_display_column']
|
||||
&& isset($_POST['relation_key_or_display_column'])
|
||||
&& $_POST['relation_key_or_display_column']
|
||||
) {
|
||||
$curr_value = $_REQUEST['relation_key_or_display_column'];
|
||||
$curr_value = $_POST['relation_key_or_display_column'];
|
||||
} else {
|
||||
$curr_value = $_REQUEST['curr_value'];
|
||||
$curr_value = $_POST['curr_value'];
|
||||
}
|
||||
$dropdown = $this->getHtmlForRelationalColumnDropdown(
|
||||
$db, $table, $column, $curr_value
|
||||
@ -894,8 +894,8 @@ EOT;
|
||||
*/
|
||||
public function getEnumOrSetValues($db, $table, $columnType)
|
||||
{
|
||||
$column = $_REQUEST['column'];
|
||||
$curr_value = $_REQUEST['curr_value'];
|
||||
$column = $_POST['column'];
|
||||
$curr_value = $_POST['curr_value'];
|
||||
$response = Response::getInstance();
|
||||
if ($columnType == "enum") {
|
||||
$dropdown = $this->getHtmlForEnumColumnDropdown(
|
||||
@ -1309,11 +1309,11 @@ EOT;
|
||||
$this->cleanupRelations(
|
||||
isset($db) ? $db : '',
|
||||
isset($table) ? $table : '',
|
||||
isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null,
|
||||
isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null
|
||||
isset($_POST['dropped_column']) ? $_POST['dropped_column'] : null,
|
||||
isset($_POST['purge']) ? $_POST['purge'] : null
|
||||
);
|
||||
|
||||
if (isset($_REQUEST['dropped_column'])
|
||||
if (isset($_POST['dropped_column'])
|
||||
&& strlen($db) > 0
|
||||
&& strlen($table) > 0
|
||||
) {
|
||||
@ -1429,7 +1429,7 @@ EOT;
|
||||
}
|
||||
|
||||
// In case of ROLLBACK, notify the user.
|
||||
if (isset($_REQUEST['rollback_query'])) {
|
||||
if (isset($_POST['rollback_query'])) {
|
||||
$message->addText(__('[ROLLBACK occurred.]'));
|
||||
}
|
||||
|
||||
@ -1639,9 +1639,9 @@ EOT;
|
||||
$editable, $unlim_num_rows, $num_rows, $showtable, $result,
|
||||
array $analyzed_sql_results, $is_limited_display = false
|
||||
) {
|
||||
$printview = isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1' ? '1' : null;
|
||||
$printview = isset($_POST['printview']) && $_POST['printview'] == '1' ? '1' : null;
|
||||
$table_html = '';
|
||||
$browse_dist = ! empty($_REQUEST['is_browse_distinct']);
|
||||
$browse_dist = ! empty($_POST['is_browse_distinct']);
|
||||
|
||||
if ($analyzed_sql_results['is_procedure']) {
|
||||
|
||||
@ -1887,7 +1887,7 @@ EOT;
|
||||
) {
|
||||
// If we are retrieving the full value of a truncated field or the original
|
||||
// value of a transformed field, show it here
|
||||
if (isset($_REQUEST['grid_edit']) && $_REQUEST['grid_edit'] == true) {
|
||||
if (isset($_POST['grid_edit']) && $_POST['grid_edit'] == true) {
|
||||
$this->sendResponseForGridEdit($result);
|
||||
// script has exited at this point
|
||||
}
|
||||
@ -1965,7 +1965,7 @@ EOT;
|
||||
);
|
||||
|
||||
}
|
||||
if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
|
||||
if (isset($_POST['printview']) && $_POST['printview'] == '1') {
|
||||
$displayParts = array(
|
||||
'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE,
|
||||
'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE,
|
||||
@ -1977,7 +1977,7 @@ EOT;
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['table_maintenance'])) {
|
||||
if (isset($_POST['table_maintenance'])) {
|
||||
$scripts->addFile('makegrid.js');
|
||||
$scripts->addFile('sql.js');
|
||||
$table_maintenance_html = '';
|
||||
@ -1999,7 +1999,7 @@ EOT;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['printview']) || $_REQUEST['printview'] != '1') {
|
||||
if (!isset($_POST['printview']) || $_POST['printview'] != '1') {
|
||||
$scripts->addFile('makegrid.js');
|
||||
$scripts->addFile('sql.js');
|
||||
unset($GLOBALS['message']);
|
||||
@ -2177,7 +2177,7 @@ EOT;
|
||||
if (! empty($analyzed_sql_results)
|
||||
&& $this->isRememberSortingOrder($analyzed_sql_results)
|
||||
&& empty($analyzed_sql_results['union'])
|
||||
&& ! isset($_REQUEST['sort_by_key'])
|
||||
&& ! isset($_POST['sort_by_key'])
|
||||
) {
|
||||
if (! isset($_SESSION['sql_from_query_box'])) {
|
||||
$this->handleSortOrder($db, $table, $analyzed_sql_results, $sql_query);
|
||||
|
||||
@ -986,8 +986,8 @@ class Table
|
||||
// Phase 1: Dropping existent element of the same name (if exists
|
||||
// and required).
|
||||
|
||||
if (isset($_REQUEST['drop_if_exists'])
|
||||
&& $_REQUEST['drop_if_exists'] == 'true'
|
||||
if (isset($_POST['drop_if_exists'])
|
||||
&& $_POST['drop_if_exists'] == 'true'
|
||||
) {
|
||||
|
||||
/**
|
||||
@ -1840,7 +1840,7 @@ class Table
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['discard_remembered_sort'])) {
|
||||
if (!isset($_POST['discard_remembered_sort'])) {
|
||||
// check if the column name exists in this table
|
||||
$tmp = explode(' ', $this->uiprefs[$property]);
|
||||
$colname = $tmp[0];
|
||||
@ -2044,13 +2044,13 @@ class Table
|
||||
);
|
||||
|
||||
// Drops the old index
|
||||
if (! empty($_REQUEST['old_index'])) {
|
||||
if ($_REQUEST['old_index'] == 'PRIMARY') {
|
||||
if (! empty($_POST['old_index'])) {
|
||||
if ($_POST['old_index'] == 'PRIMARY') {
|
||||
$sql_query .= ' DROP PRIMARY KEY,';
|
||||
} else {
|
||||
$sql_query .= sprintf(
|
||||
' DROP INDEX %s,',
|
||||
Util::backquote($_REQUEST['old_index'])
|
||||
Util::backquote($_POST['old_index'])
|
||||
);
|
||||
}
|
||||
} // end if
|
||||
@ -2339,9 +2339,9 @@ class Table
|
||||
|| $existrel_foreign[$master_field_md5]['ref_table_name'] != $foreign_table
|
||||
|| $existrel_foreign[$master_field_md5]['ref_index_list'] != $foreign_field
|
||||
|| $existrel_foreign[$master_field_md5]['index_list'] != $master_field
|
||||
|| $_REQUEST['constraint_name'][$master_field_md5] != $constraint_name
|
||||
|| ($_REQUEST['on_delete'][$master_field_md5] != $on_delete)
|
||||
|| ($_REQUEST['on_update'][$master_field_md5] != $on_update)
|
||||
|| $_POST['constraint_name'][$master_field_md5] != $constraint_name
|
||||
|| ($_POST['on_delete'][$master_field_md5] != $on_delete)
|
||||
|| ($_POST['on_update'][$master_field_md5] != $on_update)
|
||||
) {
|
||||
// another foreign key is already defined for this field
|
||||
// or an option has been changed for ON DELETE or ON UPDATE
|
||||
@ -2365,7 +2365,7 @@ class Table
|
||||
)
|
||||
. ';';
|
||||
|
||||
if (! isset($_REQUEST['preview_sql'])) {
|
||||
if (! isset($_POST['preview_sql'])) {
|
||||
$display_query .= $drop_query . "\n";
|
||||
$this->_dbi->tryQuery($drop_query);
|
||||
$tmp_error_drop = $this->_dbi->getError();
|
||||
@ -2388,12 +2388,12 @@ class Table
|
||||
|
||||
$create_query = $this->_getSQLToCreateForeignKey(
|
||||
$table, $master_field, $foreign_db, $foreign_table, $foreign_field,
|
||||
$_REQUEST['constraint_name'][$master_field_md5],
|
||||
$options_array[$_REQUEST['on_delete'][$master_field_md5]],
|
||||
$options_array[$_REQUEST['on_update'][$master_field_md5]]
|
||||
$_POST['constraint_name'][$master_field_md5],
|
||||
$options_array[$_POST['on_delete'][$master_field_md5]],
|
||||
$options_array[$_POST['on_update'][$master_field_md5]]
|
||||
);
|
||||
|
||||
if (! isset($_REQUEST['preview_sql'])) {
|
||||
if (! isset($_POST['preview_sql'])) {
|
||||
$display_query .= $create_query . "\n";
|
||||
$this->_dbi->tryQuery($create_query);
|
||||
$tmp_error_create = $this->_dbi->getError();
|
||||
@ -2439,7 +2439,7 @@ class Table
|
||||
$options_array[$existrel_foreign[$master_field_md5]['on_delete']],
|
||||
$options_array[$existrel_foreign[$master_field_md5]['on_update']]
|
||||
);
|
||||
if (! isset($_REQUEST['preview_sql'])) {
|
||||
if (! isset($_POST['preview_sql'])) {
|
||||
$display_query .= $sql_query_recreate . "\n";
|
||||
$this->_dbi->tryQuery($sql_query_recreate);
|
||||
} else {
|
||||
|
||||
@ -122,10 +122,10 @@ class Tracking
|
||||
$sql_query = " SELECT * FROM " .
|
||||
Util::backquote($cfgRelation['db']) . "." .
|
||||
Util::backquote($cfgRelation['tracking']) .
|
||||
" WHERE db_name = '" . $GLOBALS['dbi']->escapeString($_REQUEST['db']) .
|
||||
" WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) .
|
||||
"' " .
|
||||
" AND table_name = '" .
|
||||
$GLOBALS['dbi']->escapeString($_REQUEST['table']) . "' " .
|
||||
$GLOBALS['dbi']->escapeString($GLOBALS['table']) . "' " .
|
||||
" ORDER BY version DESC ";
|
||||
|
||||
return $relation->queryAsControlUser($sql_query);
|
||||
@ -179,9 +179,6 @@ class Tracking
|
||||
$tracking_active = false;
|
||||
}
|
||||
}
|
||||
$delete_link = 'tbl_tracking.php' . $url_query . '&version='
|
||||
. htmlspecialchars($version['version'])
|
||||
. '&submit_delete_version=true';
|
||||
$checkbox_id = 'selected_versions_' . htmlspecialchars($version['version']);
|
||||
|
||||
$html .= '<tr>';
|
||||
@ -198,21 +195,24 @@ class Tracking
|
||||
$html .= '<td>' . htmlspecialchars($version['date_updated']) . '</td>';
|
||||
$html .= '<td>' . self::getVersionStatus($version) . '</td>';
|
||||
$html .= '<td><a class="delete_version_anchor ajax"'
|
||||
. ' href="' . $delete_link . '" >' . $delete . '</a></td>';
|
||||
$html .= '<td><a href="tbl_tracking.php';
|
||||
$html .= Url::getCommon(
|
||||
$url_params + array(
|
||||
'report' => 'true', 'version' => $version['version']
|
||||
)
|
||||
);
|
||||
. ' href="tbl_tracking.php" data-post="';
|
||||
$html .= Url::getCommon($url_params + [
|
||||
'version' => $version['version'],
|
||||
'submit_delete_version' => true,
|
||||
], '');
|
||||
$html .= '">' . $delete . '</a></td>';
|
||||
$html .= '<td><a href="tbl_tracking.php" data-post="';
|
||||
$html .= Url::getCommon($url_params + [
|
||||
'report' => 'true',
|
||||
'version' => $version['version'],
|
||||
], '');
|
||||
$html .= '">' . $report . '</a>';
|
||||
$html .= ' ';
|
||||
$html .= '<a href="tbl_tracking.php';
|
||||
$html .= Url::getCommon(
|
||||
$url_params + array(
|
||||
'snapshot' => 'true', 'version' => $version['version']
|
||||
)
|
||||
);
|
||||
$html .= '<a href="tbl_tracking.php" data-post="';
|
||||
$html .= Url::getCommon($url_params + [
|
||||
'snapshot' => 'true',
|
||||
'version' => $version['version'],
|
||||
], '');
|
||||
$html .= '">' . $structure . '</a>';
|
||||
$html .= '</td>';
|
||||
$html .= '</tr>';
|
||||
@ -308,7 +308,7 @@ class Tracking
|
||||
'db' => $GLOBALS['db'],
|
||||
'table' => $GLOBALS['table'],
|
||||
'entries' => $entries,
|
||||
'selected_table' => isset($_REQUEST['table']) ? $_REQUEST['table'] : null,
|
||||
'selected_table' => isset($_POST['table']) ? $_POST['table'] : null,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -401,11 +401,11 @@ class Tracking
|
||||
. __('Structure and data') . '</option>'
|
||||
. '</select>';
|
||||
$str2 = '<input type="text" name="date_from" value="'
|
||||
. htmlspecialchars($_REQUEST['date_from']) . '" size="19" />';
|
||||
. htmlspecialchars($_POST['date_from']) . '" size="19" />';
|
||||
$str3 = '<input type="text" name="date_to" value="'
|
||||
. htmlspecialchars($_REQUEST['date_to']) . '" size="19" />';
|
||||
. htmlspecialchars($_POST['date_to']) . '" size="19" />';
|
||||
$str4 = '<input type="text" name="users" value="'
|
||||
. htmlspecialchars($_REQUEST['users']) . '" />';
|
||||
. htmlspecialchars($_POST['users']) . '" />';
|
||||
$str5 = '<input type="hidden" name="list_report" value="1" />'
|
||||
. '<input type="submit" value="' . __('Go') . '" />';
|
||||
return array($str1, $str2, $str3, $str4, $str5);
|
||||
@ -438,14 +438,11 @@ class Tracking
|
||||
) {
|
||||
$ddlog_count = 0;
|
||||
|
||||
$html = '<form method="post" action="tbl_tracking.php'
|
||||
. Url::getCommon(
|
||||
$url_params + array(
|
||||
'report' => 'true', 'version' => $_REQUEST['version']
|
||||
)
|
||||
)
|
||||
. '">';
|
||||
$html .= Url::getHiddenInputs();
|
||||
$html = '<form method="post" action="tbl_tracking.php">';
|
||||
$html .= Url::getHiddenInputs($url_params + [
|
||||
'report' => 'true',
|
||||
'version' => $_POST['version'],
|
||||
]);
|
||||
|
||||
$html .= sprintf(
|
||||
__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'),
|
||||
@ -489,35 +486,28 @@ class Tracking
|
||||
public static function getHtmlForTrackingReportExportForm2(
|
||||
array $url_params, $str1, $str2, $str3, $str4, $str5
|
||||
) {
|
||||
$html = '<form method="post" action="tbl_tracking.php'
|
||||
. Url::getCommon(
|
||||
$url_params + array(
|
||||
'report' => 'true', 'version' => $_REQUEST['version']
|
||||
)
|
||||
)
|
||||
. '">';
|
||||
$html .= Url::getHiddenInputs();
|
||||
$html = '<form method="post" action="tbl_tracking.php">';
|
||||
$html .= Url::getHiddenInputs($url_params + [
|
||||
'report' => 'true',
|
||||
'version' => $_POST['version'],
|
||||
]);
|
||||
|
||||
$html .= sprintf(
|
||||
__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'),
|
||||
$str1, $str2, $str3, $str4, $str5
|
||||
);
|
||||
$html .= '</form>';
|
||||
|
||||
$html .= '<form class="disableAjax" method="post" action="tbl_tracking.php'
|
||||
. Url::getCommon(
|
||||
$url_params
|
||||
+ array('report' => 'true', 'version' => $_REQUEST['version'])
|
||||
)
|
||||
. '">';
|
||||
$html .= Url::getHiddenInputs();
|
||||
$html .= '<input type="hidden" name="logtype" value="'
|
||||
. htmlspecialchars($_REQUEST['logtype']) . '" />';
|
||||
$html .= '<input type="hidden" name="date_from" value="'
|
||||
. htmlspecialchars($_REQUEST['date_from']) . '" />';
|
||||
$html .= '<input type="hidden" name="date_to" value="'
|
||||
. htmlspecialchars($_REQUEST['date_to']) . '" />';
|
||||
$html .= '<input type="hidden" name="users" value="'
|
||||
. htmlspecialchars($_REQUEST['users']) . '" />';
|
||||
$html .= '<form class="disableAjax" method="post" action="tbl_tracking.php">';
|
||||
$html .= Url::getHiddenInputs($url_params + [
|
||||
'report' => 'true',
|
||||
'version' => $_POST['version'],
|
||||
'logtype' => $_POST['logtype'],
|
||||
'date_from' => $_POST['date_from'],
|
||||
'date_to' => $_POST['date_to'],
|
||||
'users' => $_POST['users'],
|
||||
'report_export' => 'true',
|
||||
]);
|
||||
|
||||
$str_export1 = '<select name="export_type">'
|
||||
. '<option value="sqldumpfile">' . __('SQL dump (file download)')
|
||||
@ -529,8 +519,7 @@ class Tracking
|
||||
)
|
||||
. '\')">' . __('SQL execution') . '</option>' . '</select>';
|
||||
|
||||
$str_export2 = '<input type="hidden" name="report_export" value="1" />'
|
||||
. '<input type="submit" value="' . __('Go') . '" />';
|
||||
$str_export2 = '<input type="submit" value="' . __('Go') . '" />';
|
||||
|
||||
$html .= "<br/>" . sprintf(__('Export as %s'), $str_export1)
|
||||
. $str_export2 . "<br/>";
|
||||
@ -630,9 +619,9 @@ class Tracking
|
||||
$deleteParam = 'delete_' . $whichLog;
|
||||
$entry['url_params'] = Url::getCommon($urlParams + [
|
||||
'report' => 'true',
|
||||
'version' => $_REQUEST['version'],
|
||||
'version' => $_POST['version'],
|
||||
$deleteParam => ($lineNumber - $offset),
|
||||
]);
|
||||
], '');
|
||||
$entry['line_number'] = $lineNumber;
|
||||
$entries[] = $entry;
|
||||
}
|
||||
@ -662,7 +651,7 @@ class Tracking
|
||||
. ' [<a href="tbl_tracking.php' . $url_query . '">' . __('Close')
|
||||
. '</a>]</h3>';
|
||||
$data = Tracker::getTrackedData(
|
||||
$_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']
|
||||
$_POST['db'], $_POST['table'], $_POST['version']
|
||||
);
|
||||
|
||||
// Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
|
||||
@ -677,7 +666,7 @@ class Tracking
|
||||
$html .= Util::getMessage(
|
||||
sprintf(
|
||||
__('Version %s snapshot (SQL code)'),
|
||||
htmlspecialchars($_REQUEST['version'])
|
||||
htmlspecialchars($_POST['version'])
|
||||
),
|
||||
$drop_create_statements
|
||||
);
|
||||
@ -737,7 +726,7 @@ class Tracking
|
||||
public static function deleteTrackingReportRows(array &$data)
|
||||
{
|
||||
$html = '';
|
||||
if (isset($_REQUEST['delete_ddlog'])) {
|
||||
if (isset($_POST['delete_ddlog'])) {
|
||||
// Delete ddlog row data
|
||||
$html .= self::deleteFromTrackingReportLog(
|
||||
$data,
|
||||
@ -747,7 +736,7 @@ class Tracking
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['delete_dmlog'])) {
|
||||
if (isset($_POST['delete_dmlog'])) {
|
||||
// Delete dmlog row data
|
||||
$html .= self::deleteFromTrackingReportLog(
|
||||
$data,
|
||||
@ -772,16 +761,16 @@ class Tracking
|
||||
public static function deleteFromTrackingReportLog(array &$data, $which_log, $type, $message)
|
||||
{
|
||||
$html = '';
|
||||
$delete_id = $_REQUEST['delete_' . $which_log];
|
||||
$delete_id = $_POST['delete_' . $which_log];
|
||||
|
||||
// Only in case of valid id
|
||||
if ($delete_id == (int)$delete_id) {
|
||||
unset($data[$which_log][$delete_id]);
|
||||
|
||||
$successfullyDeleted = Tracker::changeTrackingData(
|
||||
$_REQUEST['db'],
|
||||
$_REQUEST['table'],
|
||||
$_REQUEST['version'],
|
||||
$GLOBALS['db'],
|
||||
$GLOBALS['table'],
|
||||
$_POST['version'],
|
||||
$type,
|
||||
$data[$which_log]
|
||||
);
|
||||
@ -867,7 +856,7 @@ class Tracking
|
||||
ini_set('url_rewriter.tags', '');
|
||||
|
||||
// Replace all multiple whitespaces by a single space
|
||||
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_REQUEST['table']));
|
||||
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_POST['table']));
|
||||
$dump = "# " . sprintf(
|
||||
__('Tracking report for table `%s`'), $table
|
||||
)
|
||||
@ -905,14 +894,14 @@ class Tracking
|
||||
$message = __('Tracking for %1$s was deactivated at version %2$s.');
|
||||
}
|
||||
$status = Tracker::$method(
|
||||
$GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']
|
||||
$GLOBALS['db'], $GLOBALS['table'], $_POST['version']
|
||||
);
|
||||
if ($status) {
|
||||
$msg = Message::success(
|
||||
sprintf(
|
||||
$message,
|
||||
htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']),
|
||||
htmlspecialchars($_REQUEST['version'])
|
||||
htmlspecialchars($_POST['version'])
|
||||
)
|
||||
);
|
||||
$html .= $msg->getDisplay();
|
||||
@ -932,43 +921,43 @@ class Tracking
|
||||
|
||||
// a key is absent from the request if it has been removed from
|
||||
// tracking_default_statements in the config
|
||||
if (isset($_REQUEST['alter_table']) && $_REQUEST['alter_table'] == true) {
|
||||
if (isset($_POST['alter_table']) && $_POST['alter_table'] == true) {
|
||||
$tracking_set .= 'ALTER TABLE,';
|
||||
}
|
||||
if (isset($_REQUEST['rename_table']) && $_REQUEST['rename_table'] == true) {
|
||||
if (isset($_POST['rename_table']) && $_POST['rename_table'] == true) {
|
||||
$tracking_set .= 'RENAME TABLE,';
|
||||
}
|
||||
if (isset($_REQUEST['create_table']) && $_REQUEST['create_table'] == true) {
|
||||
if (isset($_POST['create_table']) && $_POST['create_table'] == true) {
|
||||
$tracking_set .= 'CREATE TABLE,';
|
||||
}
|
||||
if (isset($_REQUEST['drop_table']) && $_REQUEST['drop_table'] == true) {
|
||||
if (isset($_POST['drop_table']) && $_POST['drop_table'] == true) {
|
||||
$tracking_set .= 'DROP TABLE,';
|
||||
}
|
||||
if (isset($_REQUEST['alter_view']) && $_REQUEST['alter_view'] == true) {
|
||||
if (isset($_POST['alter_view']) && $_POST['alter_view'] == true) {
|
||||
$tracking_set .= 'ALTER VIEW,';
|
||||
}
|
||||
if (isset($_REQUEST['create_view']) && $_REQUEST['create_view'] == true) {
|
||||
if (isset($_POST['create_view']) && $_POST['create_view'] == true) {
|
||||
$tracking_set .= 'CREATE VIEW,';
|
||||
}
|
||||
if (isset($_REQUEST['drop_view']) && $_REQUEST['drop_view'] == true) {
|
||||
if (isset($_POST['drop_view']) && $_POST['drop_view'] == true) {
|
||||
$tracking_set .= 'DROP VIEW,';
|
||||
}
|
||||
if (isset($_REQUEST['create_index']) && $_REQUEST['create_index'] == true) {
|
||||
if (isset($_POST['create_index']) && $_POST['create_index'] == true) {
|
||||
$tracking_set .= 'CREATE INDEX,';
|
||||
}
|
||||
if (isset($_REQUEST['drop_index']) && $_REQUEST['drop_index'] == true) {
|
||||
if (isset($_POST['drop_index']) && $_POST['drop_index'] == true) {
|
||||
$tracking_set .= 'DROP INDEX,';
|
||||
}
|
||||
if (isset($_REQUEST['insert']) && $_REQUEST['insert'] == true) {
|
||||
if (isset($_POST['insert']) && $_POST['insert'] == true) {
|
||||
$tracking_set .= 'INSERT,';
|
||||
}
|
||||
if (isset($_REQUEST['update']) && $_REQUEST['update'] == true) {
|
||||
if (isset($_POST['update']) && $_POST['update'] == true) {
|
||||
$tracking_set .= 'UPDATE,';
|
||||
}
|
||||
if (isset($_REQUEST['delete']) && $_REQUEST['delete'] == true) {
|
||||
if (isset($_POST['delete']) && $_POST['delete'] == true) {
|
||||
$tracking_set .= 'DELETE,';
|
||||
}
|
||||
if (isset($_REQUEST['truncate']) && $_REQUEST['truncate'] == true) {
|
||||
if (isset($_POST['truncate']) && $_POST['truncate'] == true) {
|
||||
$tracking_set .= 'TRUNCATE,';
|
||||
}
|
||||
$tracking_set = rtrim($tracking_set, ',');
|
||||
@ -1018,7 +1007,7 @@ class Tracking
|
||||
$versionCreated = Tracker::createVersion(
|
||||
$GLOBALS['db'],
|
||||
$GLOBALS['table'],
|
||||
$_REQUEST['version'],
|
||||
$_POST['version'],
|
||||
$tracking_set,
|
||||
$GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table'])->isView()
|
||||
);
|
||||
@ -1026,7 +1015,7 @@ class Tracking
|
||||
$msg = Message::success(
|
||||
sprintf(
|
||||
__('Version %1$s was created, tracking for %2$s is active.'),
|
||||
htmlspecialchars($_REQUEST['version']),
|
||||
htmlspecialchars($_POST['version']),
|
||||
htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])
|
||||
)
|
||||
);
|
||||
@ -1051,7 +1040,7 @@ class Tracking
|
||||
Tracker::createVersion(
|
||||
$GLOBALS['db'],
|
||||
$selected_table,
|
||||
$_REQUEST['version'],
|
||||
$_POST['version'],
|
||||
$tracking_set,
|
||||
$GLOBALS['dbi']->getTable($GLOBALS['db'], $selected_table)->isView()
|
||||
);
|
||||
@ -1072,8 +1061,8 @@ class Tracking
|
||||
{
|
||||
$entries = array();
|
||||
// Filtering data definition statements
|
||||
if ($_REQUEST['logtype'] == 'schema'
|
||||
|| $_REQUEST['logtype'] == 'schema_and_data'
|
||||
if ($_POST['logtype'] == 'schema'
|
||||
|| $_POST['logtype'] == 'schema_and_data'
|
||||
) {
|
||||
$entries = array_merge(
|
||||
$entries,
|
||||
@ -1084,8 +1073,8 @@ class Tracking
|
||||
}
|
||||
|
||||
// Filtering data manipulation statements
|
||||
if ($_REQUEST['logtype'] == 'data'
|
||||
|| $_REQUEST['logtype'] == 'schema_and_data'
|
||||
if ($_POST['logtype'] == 'data'
|
||||
|| $_POST['logtype'] == 'schema_and_data'
|
||||
) {
|
||||
$entries = array_merge(
|
||||
$entries,
|
||||
@ -1227,7 +1216,7 @@ class Tracking
|
||||
Util::backquote($cfgRelation['db']) . '.' .
|
||||
Util::backquote($cfgRelation['tracking']) .
|
||||
' WHERE `db_name` = \''
|
||||
. $GLOBALS['dbi']->escapeString($_REQUEST['db'])
|
||||
. $GLOBALS['dbi']->escapeString($GLOBALS['db'])
|
||||
. '\' AND `table_name` = \''
|
||||
. $GLOBALS['dbi']->escapeString($tableName)
|
||||
. '\' AND `version` = \'' . $versionNumber . '\'';
|
||||
@ -1243,7 +1232,6 @@ class Tracking
|
||||
return Template::get('database/tracking/tracked_tables')->render([
|
||||
'db' => $db,
|
||||
'versions' => $versions,
|
||||
'url_query' => $urlQuery,
|
||||
'text_dir' => $textDir,
|
||||
'pma_theme_image' => $pmaThemeImage,
|
||||
]);
|
||||
|
||||
@ -61,16 +61,16 @@ class UserPassword
|
||||
$error = false;
|
||||
$message = Message::success(__('The profile has been updated.'));
|
||||
|
||||
if (($_REQUEST['nopass'] != '1')) {
|
||||
if (strlen($_REQUEST['pma_pw']) === 0 || strlen($_REQUEST['pma_pw2']) === 0) {
|
||||
if (($_POST['nopass'] != '1')) {
|
||||
if (strlen($_POST['pma_pw']) === 0 || strlen($_POST['pma_pw2']) === 0) {
|
||||
$message = Message::error(__('The password is empty!'));
|
||||
$error = true;
|
||||
} elseif ($_REQUEST['pma_pw'] !== $_REQUEST['pma_pw2']) {
|
||||
} elseif ($_POST['pma_pw'] !== $_POST['pma_pw2']) {
|
||||
$message = Message::error(
|
||||
__('The passwords aren\'t the same!')
|
||||
);
|
||||
$error = true;
|
||||
} elseif (strlen($_REQUEST['pma_pw']) > 256) {
|
||||
} elseif (strlen($_POST['pma_pw']) > 256) {
|
||||
$message = Message::error(__('Password is too long!'));
|
||||
$error = true;
|
||||
}
|
||||
@ -98,10 +98,10 @@ class UserPassword
|
||||
$serverType = Util::getServerType();
|
||||
$serverVersion = $GLOBALS['dbi']->getVersion();
|
||||
|
||||
if (isset($_REQUEST['authentication_plugin'])
|
||||
&& ! empty($_REQUEST['authentication_plugin'])
|
||||
if (isset($_POST['authentication_plugin'])
|
||||
&& ! empty($_POST['authentication_plugin'])
|
||||
) {
|
||||
$orig_auth_plugin = $_REQUEST['authentication_plugin'];
|
||||
$orig_auth_plugin = $_POST['authentication_plugin'];
|
||||
} else {
|
||||
$orig_auth_plugin = Privileges::getCurrentAuthenticationPlugin(
|
||||
'change', $username, $hostname
|
||||
@ -152,7 +152,7 @@ class UserPassword
|
||||
private function changePassHashingFunction()
|
||||
{
|
||||
if (Core::isValid(
|
||||
$_REQUEST['authentication_plugin'], 'identical', 'mysql_old_password'
|
||||
$_POST['authentication_plugin'], 'identical', 'mysql_old_password'
|
||||
)) {
|
||||
$hashing_function = 'OLD_PASSWORD';
|
||||
} else {
|
||||
|
||||
@ -37,8 +37,8 @@ $request_params = array(
|
||||
);
|
||||
|
||||
foreach ($request_params as $one_request_param) {
|
||||
if (isset($_REQUEST[$one_request_param])) {
|
||||
$GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
|
||||
if (isset($_POST[$one_request_param])) {
|
||||
$GLOBALS[$one_request_param] = $_POST[$one_request_param];
|
||||
}
|
||||
}
|
||||
$response = Response::getInstance();
|
||||
@ -55,16 +55,16 @@ $multSubmits = new MultSubmits();
|
||||
*/
|
||||
if (! empty($submit_mult)
|
||||
&& $submit_mult != __('With selected:')
|
||||
&& (! empty($_REQUEST['selected_dbs'])
|
||||
&& (! empty($_POST['selected_dbs'])
|
||||
|| ! empty($_POST['selected_tbl'])
|
||||
|| ! empty($selected_fld)
|
||||
|| ! empty($_REQUEST['rows_to_delete']))
|
||||
|| ! empty($_POST['rows_to_delete']))
|
||||
) {
|
||||
define('PMA_SUBMIT_MULT', 1);
|
||||
if (! empty($_REQUEST['selected_dbs'])) {
|
||||
if (! empty($_POST['selected_dbs'])) {
|
||||
// coming from server database view - do something with
|
||||
// selected databases
|
||||
$selected = $_REQUEST['selected_dbs'];
|
||||
$selected = $_POST['selected_dbs'];
|
||||
$query_type = 'drop_db';
|
||||
} elseif (! empty($_POST['selected_tbl'])) {
|
||||
// coming from database structure view - do something with
|
||||
|
||||
@ -19,7 +19,7 @@ $server_master_replication = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS');
|
||||
/**
|
||||
* set selected master server
|
||||
*/
|
||||
if (! empty($_REQUEST['master_connection'])) {
|
||||
if (! empty($_POST['master_connection'])) {
|
||||
/**
|
||||
* check for multi-master replication functionality
|
||||
*/
|
||||
@ -30,10 +30,10 @@ if (! empty($_REQUEST['master_connection'])) {
|
||||
$GLOBALS['dbi']->query(
|
||||
"SET @@default_master_connection = '"
|
||||
. $GLOBALS['dbi']->escapeString(
|
||||
$_REQUEST['master_connection']
|
||||
$_POST['master_connection']
|
||||
) . "'"
|
||||
);
|
||||
$GLOBALS['url_params']['master_connection'] = $_REQUEST['master_connection'];
|
||||
$GLOBALS['url_params']['master_connection'] = $_POST['master_connection'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,10 +60,10 @@ if ($action == 'tbl_create.php') {
|
||||
if ($action == 'tbl_addfield.php') {
|
||||
$form_params = array_merge(
|
||||
$form_params, array(
|
||||
'field_where' => Util::getValueByKey($_REQUEST, 'field_where'))
|
||||
'field_where' => Util::getValueByKey($_POST, 'field_where'))
|
||||
);
|
||||
if (isset($_REQUEST['field_where'])) {
|
||||
$form_params['after_field'] = $_REQUEST['after_field'];
|
||||
if (isset($_POST['field_where'])) {
|
||||
$form_params['after_field'] = $_POST['after_field'];
|
||||
}
|
||||
}
|
||||
$form_params['table'] = $table;
|
||||
@ -76,8 +76,8 @@ if (isset($num_fields)) {
|
||||
$form_params = array_merge(
|
||||
$form_params,
|
||||
array(
|
||||
'orig_field_where' => Util::getValueByKey($_REQUEST, 'field_where'),
|
||||
'orig_after_field' => Util::getValueByKey($_REQUEST, 'after_field'),
|
||||
'orig_field_where' => Util::getValueByKey($_POST, 'field_where'),
|
||||
'orig_after_field' => Util::getValueByKey($_POST, 'after_field'),
|
||||
)
|
||||
);
|
||||
|
||||
@ -114,8 +114,8 @@ if (isset($field_fulltext) && is_array($field_fulltext)) {
|
||||
$submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
|
||||
}
|
||||
}
|
||||
if (isset($_REQUEST['submit_num_fields'])
|
||||
|| isset($_REQUEST['submit_partition_change'])
|
||||
if (isset($_POST['submit_num_fields'])
|
||||
|| isset($_POST['submit_partition_change'])
|
||||
) {
|
||||
//if adding new fields, set regenerate to keep the original values
|
||||
$regenerate = 1;
|
||||
@ -143,38 +143,38 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
|
||||
$columnMeta,
|
||||
array(
|
||||
'Field' => Util::getValueByKey(
|
||||
$_REQUEST, "field_name.${columnNumber}", false
|
||||
$_POST, "field_name.${columnNumber}", false
|
||||
),
|
||||
'Type' => Util::getValueByKey(
|
||||
$_REQUEST, "field_type.${columnNumber}", false
|
||||
$_POST, "field_type.${columnNumber}", false
|
||||
),
|
||||
'Collation' => Util::getValueByKey(
|
||||
$_REQUEST, "field_collation.${columnNumber}", ''
|
||||
$_POST, "field_collation.${columnNumber}", ''
|
||||
),
|
||||
'Null' => Util::getValueByKey(
|
||||
$_REQUEST, "field_null.${columnNumber}", ''
|
||||
$_POST, "field_null.${columnNumber}", ''
|
||||
),
|
||||
'DefaultType' => Util::getValueByKey(
|
||||
$_REQUEST, "field_default_type.${columnNumber}", 'NONE'
|
||||
$_POST, "field_default_type.${columnNumber}", 'NONE'
|
||||
),
|
||||
'DefaultValue' => Util::getValueByKey(
|
||||
$_REQUEST, "field_default_value.${columnNumber}", ''
|
||||
$_POST, "field_default_value.${columnNumber}", ''
|
||||
),
|
||||
'Extra' => Util::getValueByKey(
|
||||
$_REQUEST, "field_extra.${columnNumber}", false
|
||||
$_POST, "field_extra.${columnNumber}", false
|
||||
),
|
||||
'Virtuality' => Util::getValueByKey(
|
||||
$_REQUEST, "field_virtuality.${columnNumber}", ''
|
||||
$_POST, "field_virtuality.${columnNumber}", ''
|
||||
),
|
||||
'Expression' => Util::getValueByKey(
|
||||
$_REQUEST, "field_expression.${columnNumber}", ''
|
||||
$_POST, "field_expression.${columnNumber}", ''
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$columnMeta['Key'] = '';
|
||||
$parts = explode(
|
||||
'_', Util::getValueByKey($_REQUEST, "field_key.${columnNumber}", ''), 2
|
||||
'_', Util::getValueByKey($_POST, "field_key.${columnNumber}", ''), 2
|
||||
);
|
||||
if (count($parts) == 2 && $parts[1] == $columnNumber) {
|
||||
$columnMeta['Key'] = Util::getValueByKey(
|
||||
@ -208,23 +208,23 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
|
||||
break;
|
||||
}
|
||||
|
||||
$length = Util::getValueByKey($_REQUEST, "field_length.${columnNumber}", $length);
|
||||
$length = Util::getValueByKey($_POST, "field_length.${columnNumber}", $length);
|
||||
$submit_attribute = Util::getValueByKey(
|
||||
$_REQUEST, "field_attribute.${columnNumber}", false
|
||||
$_POST, "field_attribute.${columnNumber}", false
|
||||
);
|
||||
$comments_map[$columnMeta['Field']] = Util::getValueByKey(
|
||||
$_REQUEST, "field_comments.${columnNumber}"
|
||||
$_POST, "field_comments.${columnNumber}"
|
||||
);
|
||||
|
||||
$mime_map[$columnMeta['Field']] = array_merge(
|
||||
$mime_map[$columnMeta['Field']],
|
||||
array(
|
||||
'mimetype' => Util::getValueByKey($_REQUEST, "field_mimetype.${$columnNumber}"),
|
||||
'mimetype' => Util::getValueByKey($_POST, "field_mimetype.${$columnNumber}"),
|
||||
'transformation' => Util::getValueByKey(
|
||||
$_REQUEST, "field_transformation.${$columnNumber}"
|
||||
$_POST, "field_transformation.${$columnNumber}"
|
||||
),
|
||||
'transformation_options' => Util::getValueByKey(
|
||||
$_REQUEST, "field_transformation_options.${$columnNumber}"
|
||||
$_POST, "field_transformation_options.${$columnNumber}"
|
||||
),
|
||||
)
|
||||
);
|
||||
@ -405,17 +405,17 @@ $html = Template::get('columns_definitions/column_definitions_form')->render([
|
||||
'form_params' => $form_params,
|
||||
'content_cells' => $content_cells,
|
||||
'partition_details' => $partitionDetails,
|
||||
'primary_indexes' => isset($_REQUEST['primary_indexes']) ? $_REQUEST['primary_indexes'] : null,
|
||||
'unique_indexes' => isset($_REQUEST['unique_indexes']) ? $_REQUEST['unique_indexes'] : null,
|
||||
'indexes' => isset($_REQUEST['indexes']) ? $_REQUEST['indexes'] : null,
|
||||
'fulltext_indexes' => isset($_REQUEST['fulltext_indexes']) ? $_REQUEST['fulltext_indexes'] : null,
|
||||
'spatial_indexes' => isset($_REQUEST['spatial_indexes']) ? $_REQUEST['spatial_indexes'] : null,
|
||||
'table' => isset($_REQUEST['table']) ? $_REQUEST['table'] : null,
|
||||
'comment' => isset($_REQUEST['comment']) ? $_REQUEST['comment'] : null,
|
||||
'tbl_collation' => isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null,
|
||||
'tbl_storage_engine' => isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null,
|
||||
'connection' => isset($_REQUEST['connection']) ? $_REQUEST['connection'] : null,
|
||||
'change_column' => isset($_REQUEST['change_column']) ? $_REQUEST['change_column'] : null,
|
||||
'primary_indexes' => isset($_POST['primary_indexes']) ? $_POST['primary_indexes'] : null,
|
||||
'unique_indexes' => isset($_POST['unique_indexes']) ? $_POST['unique_indexes'] : null,
|
||||
'indexes' => isset($_POST['indexes']) ? $_POST['indexes'] : null,
|
||||
'fulltext_indexes' => isset($_POST['fulltext_indexes']) ? $_POST['fulltext_indexes'] : null,
|
||||
'spatial_indexes' => isset($_POST['spatial_indexes']) ? $_POST['spatial_indexes'] : null,
|
||||
'table' => isset($_POST['table']) ? $_POST['table'] : null,
|
||||
'comment' => isset($_POST['comment']) ? $_POST['comment'] : null,
|
||||
'tbl_collation' => isset($_POST['tbl_collation']) ? $_POST['tbl_collation'] : null,
|
||||
'tbl_storage_engine' => isset($_POST['tbl_storage_engine']) ? $_POST['tbl_storage_engine'] : null,
|
||||
'connection' => isset($_POST['connection']) ? $_POST['connection'] : null,
|
||||
'change_column' => isset($_POST['change_column']) ? $_POST['change_column'] : null,
|
||||
'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(),
|
||||
'browse_mime' => isset($GLOBALS['cfg']['BrowseMIME']) ? $GLOBALS['cfg']['BrowseMIME'] : null,
|
||||
'server_type' => Util::getServerType(),
|
||||
|
||||
@ -18,21 +18,21 @@ if (!isset($partitionDetails)) {
|
||||
'subpartition_by', 'subpartition_expr',
|
||||
);
|
||||
foreach ($partitionParams as $partitionParam) {
|
||||
$partitionDetails[$partitionParam] = isset($_REQUEST[$partitionParam])
|
||||
? $_REQUEST[$partitionParam] : '';
|
||||
$partitionDetails[$partitionParam] = isset($_POST[$partitionParam])
|
||||
? $_POST[$partitionParam] : '';
|
||||
}
|
||||
|
||||
if (Core::isValid($_REQUEST['partition_count'], 'numeric')) {
|
||||
if (Core::isValid($_POST['partition_count'], 'numeric')) {
|
||||
// MySQL's limit is 8192, so do not allow more
|
||||
$partition_count = min(intval($_REQUEST['partition_count']), 8192);
|
||||
$partition_count = min(intval($_POST['partition_count']), 8192);
|
||||
} else {
|
||||
$partition_count = 0;
|
||||
}
|
||||
$partitionDetails['partition_count']
|
||||
= ($partition_count === 0) ? '' : $partition_count;
|
||||
if (Core::isValid($_REQUEST['subpartition_count'], 'numeric')) {
|
||||
if (Core::isValid($_POST['subpartition_count'], 'numeric')) {
|
||||
// MySQL's limit is 8192, so do not allow more
|
||||
$subpartition_count = min(intval($_REQUEST['subpartition_count']), 8192);
|
||||
$subpartition_count = min(intval($_POST['subpartition_count']), 8192);
|
||||
} else {
|
||||
$subpartition_count = 0;
|
||||
}
|
||||
@ -41,23 +41,23 @@ if (!isset($partitionDetails)) {
|
||||
|
||||
// Only LIST and RANGE type parameters allow subpartitioning
|
||||
$partitionDetails['can_have_subpartitions'] = $partition_count > 1
|
||||
&& isset($_REQUEST['partition_by'])
|
||||
&& ($_REQUEST['partition_by'] == 'RANGE'
|
||||
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|
||||
|| $_REQUEST['partition_by'] == 'LIST'
|
||||
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
|
||||
&& isset($_POST['partition_by'])
|
||||
&& ($_POST['partition_by'] == 'RANGE'
|
||||
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|
||||
|| $_POST['partition_by'] == 'LIST'
|
||||
|| $_POST['partition_by'] == 'LIST COLUMNS');
|
||||
|
||||
// Values are specified only for LIST and RANGE type partitions
|
||||
$partitionDetails['value_enabled'] = isset($_REQUEST['partition_by'])
|
||||
&& ($_REQUEST['partition_by'] == 'RANGE'
|
||||
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|
||||
|| $_REQUEST['partition_by'] == 'LIST'
|
||||
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
|
||||
$partitionDetails['value_enabled'] = isset($_POST['partition_by'])
|
||||
&& ($_POST['partition_by'] == 'RANGE'
|
||||
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|
||||
|| $_POST['partition_by'] == 'LIST'
|
||||
|| $_POST['partition_by'] == 'LIST COLUMNS');
|
||||
|
||||
// Has partitions
|
||||
if ($partition_count > 1) {
|
||||
$partitions = isset($_REQUEST['partitions'])
|
||||
? $_REQUEST['partitions']
|
||||
$partitions = isset($_POST['partitions'])
|
||||
? $_POST['partitions']
|
||||
: array();
|
||||
|
||||
// Remove details of the additional partitions
|
||||
|
||||
@ -26,7 +26,7 @@ if (! $response->isAjax()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
|
||||
if (isset($_POST['getNaviSettings']) && $_POST['getNaviSettings']) {
|
||||
$response->addJSON('message', PageSettings::getNaviSettings());
|
||||
exit();
|
||||
}
|
||||
@ -34,41 +34,41 @@ if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
|
||||
$relation = new Relation();
|
||||
$cfgRelation = $relation->getRelationsParam();
|
||||
if ($cfgRelation['navwork']) {
|
||||
if (isset($_REQUEST['hideNavItem'])) {
|
||||
if (! empty($_REQUEST['itemName'])
|
||||
&& ! empty($_REQUEST['itemType'])
|
||||
&& ! empty($_REQUEST['dbName'])
|
||||
if (isset($_POST['hideNavItem'])) {
|
||||
if (! empty($_POST['itemName'])
|
||||
&& ! empty($_POST['itemType'])
|
||||
&& ! empty($_POST['dbName'])
|
||||
) {
|
||||
$navigation->hideNavigationItem(
|
||||
$_REQUEST['itemName'],
|
||||
$_REQUEST['itemType'],
|
||||
$_REQUEST['dbName'],
|
||||
(! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
|
||||
$_POST['itemName'],
|
||||
$_POST['itemType'],
|
||||
$_POST['dbName'],
|
||||
(! empty($_POST['tableName']) ? $_POST['tableName'] : null)
|
||||
);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['unhideNavItem'])) {
|
||||
if (! empty($_REQUEST['itemName'])
|
||||
&& ! empty($_REQUEST['itemType'])
|
||||
&& ! empty($_REQUEST['dbName'])
|
||||
if (isset($_POST['unhideNavItem'])) {
|
||||
if (! empty($_POST['itemName'])
|
||||
&& ! empty($_POST['itemType'])
|
||||
&& ! empty($_POST['dbName'])
|
||||
) {
|
||||
$navigation->unhideNavigationItem(
|
||||
$_REQUEST['itemName'],
|
||||
$_REQUEST['itemType'],
|
||||
$_REQUEST['dbName'],
|
||||
(! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
|
||||
$_POST['itemName'],
|
||||
$_POST['itemType'],
|
||||
$_POST['dbName'],
|
||||
(! empty($_POST['tableName']) ? $_POST['tableName'] : null)
|
||||
);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['showUnhideDialog'])) {
|
||||
if (! empty($_REQUEST['dbName'])) {
|
||||
if (isset($_POST['showUnhideDialog'])) {
|
||||
if (! empty($_POST['dbName'])) {
|
||||
$response->addJSON(
|
||||
'message',
|
||||
$navigation->getItemUnhideDialog($_REQUEST['dbName'])
|
||||
$navigation->getItemUnhideDialog($_POST['dbName'])
|
||||
);
|
||||
}
|
||||
exit;
|
||||
|
||||
@ -15,7 +15,7 @@ require_once 'libraries/common.inc.php';
|
||||
|
||||
$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 @@ if (isset($_REQUEST['getColumns'])) {
|
||||
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,14 +44,14 @@ if (isset($_REQUEST['addNewPrimary'])) {
|
||||
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;
|
||||
@ -59,9 +59,9 @@ if (isset($_REQUEST['getNewTables2NF'])) {
|
||||
|
||||
$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 = $header->getScripts();
|
||||
$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 @@ if (isset($_POST['repeatingColumns'])) {
|
||||
$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 {
|
||||
|
||||
@ -37,8 +37,8 @@ $scripts = $header->getScripts();
|
||||
$scripts->addFile('server_privileges.js');
|
||||
$scripts->addFile('vendor/zxcvbn.js');
|
||||
|
||||
if ((isset($_REQUEST['viewing_mode'])
|
||||
&& $_REQUEST['viewing_mode'] == 'server')
|
||||
if ((isset($_GET['viewing_mode'])
|
||||
&& $_GET['viewing_mode'] == 'server')
|
||||
&& $GLOBALS['cfgRelation']['menuswork']
|
||||
) {
|
||||
$response->addHTML('<div>');
|
||||
@ -156,8 +156,8 @@ if (! $GLOBALS['is_grantuser'] && !$GLOBALS['is_createuser']) {
|
||||
* Checks if the user is using "Change Login Information / Copy User" dialog
|
||||
* only to update the password
|
||||
*/
|
||||
if (isset($_REQUEST['change_copy']) && $username == $_REQUEST['old_username']
|
||||
&& $hostname == $_REQUEST['old_hostname']
|
||||
if (isset($_POST['change_copy']) && $username == $_POST['old_username']
|
||||
&& $hostname == $_POST['old_hostname']
|
||||
) {
|
||||
$response->addHTML(
|
||||
Message::error(
|
||||
@ -202,7 +202,7 @@ if (isset($ret_message)) {
|
||||
/**
|
||||
* Changes / copies a user, part III
|
||||
*/
|
||||
if (isset($_REQUEST['change_copy'])) {
|
||||
if (isset($_POST['change_copy'])) {
|
||||
$queries = Privileges::getDbSpecificPrivsQueriesForChangeOrCopyUser(
|
||||
$queries, $username, $hostname
|
||||
);
|
||||
@ -247,17 +247,17 @@ if (! empty($_POST['update_privs'])) {
|
||||
/**
|
||||
* Assign users to user groups
|
||||
*/
|
||||
if (! empty($_REQUEST['changeUserGroup']) && $cfgRelation['menuswork']
|
||||
if (! empty($_POST['changeUserGroup']) && $cfgRelation['menuswork']
|
||||
&& $GLOBALS['dbi']->isSuperuser() && $GLOBALS['is_createuser']
|
||||
) {
|
||||
Privileges::setUserGroup($username, $_REQUEST['userGroup']);
|
||||
Privileges::setUserGroup($username, $_POST['userGroup']);
|
||||
$message = Message::success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Revokes Privileges
|
||||
*/
|
||||
if (isset($_REQUEST['revokeall'])) {
|
||||
if (isset($_POST['revokeall'])) {
|
||||
list ($message, $sql_query) = Privileges::getMessageAndSqlQueryForPrivilegesRevoke(
|
||||
(isset($dbname) ? $dbname : ''),
|
||||
(isset($tablename)
|
||||
@ -272,7 +272,7 @@ if (isset($_REQUEST['revokeall'])) {
|
||||
/**
|
||||
* Updates the password
|
||||
*/
|
||||
if (isset($_REQUEST['change_pw'])) {
|
||||
if (isset($_POST['change_pw'])) {
|
||||
$message = Privileges::updatePassword(
|
||||
$err_url, $username, $hostname
|
||||
);
|
||||
@ -282,11 +282,11 @@ if (isset($_REQUEST['change_pw'])) {
|
||||
* Deletes users
|
||||
* (Changes / copies a user, part IV)
|
||||
*/
|
||||
if (isset($_REQUEST['delete'])
|
||||
|| (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4)
|
||||
if (isset($_POST['delete'])
|
||||
|| (isset($_POST['change_copy']) && $_POST['mode'] < 4)
|
||||
) {
|
||||
$queries = Privileges::getDataForDeleteUsers($queries);
|
||||
if (empty($_REQUEST['change_copy'])) {
|
||||
if (empty($_POST['change_copy'])) {
|
||||
list($sql_query, $message) = Privileges::deleteUser($queries);
|
||||
}
|
||||
}
|
||||
@ -294,7 +294,7 @@ if (isset($_REQUEST['delete'])
|
||||
/**
|
||||
* Changes / copies a user, part V
|
||||
*/
|
||||
if (isset($_REQUEST['change_copy'])) {
|
||||
if (isset($_POST['change_copy'])) {
|
||||
$queries = Privileges::getDataForQueries($queries, $queries_for_display);
|
||||
$message = Message::success();
|
||||
$sql_query = join("\n", $queries);
|
||||
@ -315,14 +315,13 @@ if (isset($message_ret)) {
|
||||
*/
|
||||
if ($response->isAjax()
|
||||
&& empty($_REQUEST['ajax_page_request'])
|
||||
&& ! isset($_REQUEST['export'])
|
||||
&& (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export')
|
||||
&& ((! isset($_REQUEST['initial']) || $_REQUEST['initial'] === null
|
||||
|| $_REQUEST['initial'] === '')
|
||||
|| (isset($_REQUEST['delete']) && $_REQUEST['delete'] === __('Go')))
|
||||
&& ! isset($_REQUEST['showall'])
|
||||
&& ! isset($_REQUEST['edit_user_group_dialog'])
|
||||
&& ! isset($_REQUEST['db_specific'])
|
||||
&& ! isset($_GET['export'])
|
||||
&& (! isset($_POST['submit_mult']) || $_POST['submit_mult'] != 'export')
|
||||
&& ((! isset($_GET['initial']) || $_GET['initial'] === null
|
||||
|| $_GET['initial'] === '')
|
||||
|| (isset($_POST['delete']) && $_POST['delete'] === __('Go')))
|
||||
&& ! isset($_GET['showall'])
|
||||
&& ! isset($_GET['edit_user_group_dialog'])
|
||||
) {
|
||||
$extra_data = Privileges::getExtraDataForAjaxBehavior(
|
||||
(isset($password) ? $password : ''),
|
||||
@ -342,8 +341,8 @@ if ($response->isAjax()
|
||||
/**
|
||||
* Displays the links
|
||||
*/
|
||||
if (isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'db') {
|
||||
$GLOBALS['db'] = $_REQUEST['db'] = $_REQUEST['checkprivsdb'];
|
||||
if (isset($_GET['viewing_mode']) && $_GET['viewing_mode'] == 'db') {
|
||||
$GLOBALS['db'] = $_REQUEST['db'] = $_GET['checkprivsdb'];
|
||||
|
||||
$url_query .= '&goto=db_operations.php';
|
||||
|
||||
@ -384,8 +383,8 @@ $response->addHTML(
|
||||
);
|
||||
|
||||
// export user definition
|
||||
if (isset($_REQUEST['export'])
|
||||
|| (isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export')
|
||||
if (isset($_GET['export'])
|
||||
|| (isset($_POST['submit_mult']) && $_POST['submit_mult'] == 'export')
|
||||
) {
|
||||
list($title, $export) = Privileges::getListForExportUserDefinition(
|
||||
isset($username) ? $username : null,
|
||||
@ -403,23 +402,23 @@ if (isset($_REQUEST['export'])
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['adduser'])) {
|
||||
if (isset($_GET['adduser'])) {
|
||||
// Add user
|
||||
$response->addHTML(
|
||||
Privileges::getHtmlForAddUser((isset($dbname) ? $dbname : ''))
|
||||
);
|
||||
} elseif (isset($_REQUEST['checkprivsdb'])) {
|
||||
if (isset($_REQUEST['checkprivstable'])) {
|
||||
} elseif (isset($_GET['checkprivsdb'])) {
|
||||
if (isset($_GET['checkprivstable'])) {
|
||||
// check the privileges for a particular table.
|
||||
$response->addHTML(
|
||||
Privileges::getHtmlForSpecificTablePrivileges(
|
||||
$_REQUEST['checkprivsdb'], $_REQUEST['checkprivstable']
|
||||
$_GET['checkprivsdb'], $_GET['checkprivstable']
|
||||
)
|
||||
);
|
||||
} else {
|
||||
// check the privileges for a particular database.
|
||||
$response->addHTML(
|
||||
Privileges::getHtmlForSpecificDbPrivileges($_REQUEST['checkprivsdb'])
|
||||
Privileges::getHtmlForSpecificDbPrivileges($_GET['checkprivsdb'])
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@ -464,7 +463,7 @@ if (isset($_REQUEST['adduser'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'server')
|
||||
if ((isset($_GET['viewing_mode']) && $_GET['viewing_mode'] == 'server')
|
||||
&& $GLOBALS['cfgRelation']['menuswork']
|
||||
) {
|
||||
$response->addHTML('</div>');
|
||||
|
||||
@ -40,10 +40,10 @@ if (! $GLOBALS['dbi']->isSuperuser()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// change $GLOBALS['url_params'] with $_REQUEST['url_params']
|
||||
// change $GLOBALS['url_params'] with $_POST['url_params']
|
||||
// only if it is an array
|
||||
if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) {
|
||||
$GLOBALS['url_params'] = $_REQUEST['url_params'];
|
||||
if (isset($_POST['url_params']) && is_array($_POST['url_params'])) {
|
||||
$GLOBALS['url_params'] = $_POST['url_params'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,13 +64,13 @@ $response->addHTML(ReplicationGui::getHtmlForErrorMessage());
|
||||
|
||||
if ($GLOBALS['replication_info']['master']['status']) {
|
||||
$response->addHTML(ReplicationGui::getHtmlForMasterReplication());
|
||||
} elseif (! isset($_REQUEST['mr_configure'])
|
||||
&& ! isset($_REQUEST['repl_clear_scr'])
|
||||
} elseif (! isset($_POST['mr_configure'])
|
||||
&& ! isset($_POST['repl_clear_scr'])
|
||||
) {
|
||||
$response->addHTML(ReplicationGui::getHtmlForNotServerReplication());
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['mr_configure'])) {
|
||||
if (isset($_POST['mr_configure'])) {
|
||||
// Render the 'Master configuration' section
|
||||
$response->addHTML(ReplicationGui::getHtmlForMasterConfiguration());
|
||||
exit;
|
||||
@ -78,7 +78,7 @@ if (isset($_REQUEST['mr_configure'])) {
|
||||
|
||||
$response->addHTML('</div>');
|
||||
|
||||
if (! isset($_REQUEST['repl_clear_scr'])) {
|
||||
if (! isset($_POST['repl_clear_scr'])) {
|
||||
// Render the 'Slave configuration' section
|
||||
$response->addHTML(
|
||||
ReplicationGui::getHtmlForSlaveConfiguration(
|
||||
@ -87,6 +87,6 @@ if (! isset($_REQUEST['repl_clear_scr'])) {
|
||||
)
|
||||
);
|
||||
}
|
||||
if (isset($_REQUEST['sl_configure'])) {
|
||||
if (isset($_POST['sl_configure'])) {
|
||||
$response->addHTML(ReplicationGui::getHtmlForReplicationChangeMaster("slave_changemaster"));
|
||||
}
|
||||
|
||||
@ -24,8 +24,8 @@ if ($response->isAjax()) {
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
// real-time charting data
|
||||
if (isset($_REQUEST['chart_data'])) {
|
||||
switch($_REQUEST['type']) {
|
||||
if (isset($_POST['chart_data'])) {
|
||||
switch($_POST['type']) {
|
||||
case 'chartgrid': // Data for the monitor
|
||||
$ret = Monitor::getJsonForChartingData();
|
||||
$response->addJSON('message', $ret);
|
||||
@ -33,31 +33,31 @@ if ($response->isAjax()) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['log_data'])) {
|
||||
if (isset($_POST['log_data'])) {
|
||||
|
||||
$start = intval($_REQUEST['time_start']);
|
||||
$end = intval($_REQUEST['time_end']);
|
||||
$start = intval($_POST['time_start']);
|
||||
$end = intval($_POST['time_end']);
|
||||
|
||||
if ($_REQUEST['type'] == 'slow') {
|
||||
if ($_POST['type'] == 'slow') {
|
||||
$return = Monitor::getJsonForLogDataTypeSlow($start, $end);
|
||||
$response->addJSON('message', $return);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_REQUEST['type'] == 'general') {
|
||||
if ($_POST['type'] == 'general') {
|
||||
$return = Monitor::getJsonForLogDataTypeGeneral($start, $end);
|
||||
$response->addJSON('message', $return);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['logging_vars'])) {
|
||||
if (isset($_POST['logging_vars'])) {
|
||||
$loggingVars = Monitor::getJsonForLoggingVars();
|
||||
$response->addJSON('message', $loggingVars);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['query_analyzer'])) {
|
||||
if (isset($_POST['query_analyzer'])) {
|
||||
$return = Monitor::getJsonForQueryAnalyzer();
|
||||
$response->addJSON('message', $return);
|
||||
exit;
|
||||
|
||||
@ -25,8 +25,8 @@ $response = Response::getInstance();
|
||||
* Kills a selected process
|
||||
* on ajax request
|
||||
*/
|
||||
if ($response->isAjax() && !empty($_REQUEST['kill'])) {
|
||||
$kill = intval($_REQUEST['kill']);
|
||||
if ($response->isAjax() && !empty($_POST['kill'])) {
|
||||
$kill = intval($_POST['kill']);
|
||||
$query = $GLOBALS['dbi']->getKillQuery($kill);
|
||||
if ($GLOBALS['dbi']->tryQuery($query)) {
|
||||
$message = PhpMyAdmin\Message::success(
|
||||
@ -44,7 +44,7 @@ if ($response->isAjax() && !empty($_REQUEST['kill'])) {
|
||||
}
|
||||
$message->addParam($kill);
|
||||
$response->addJSON('message', $message);
|
||||
} elseif ($response->isAjax() && !empty($_REQUEST['refresh'])) {
|
||||
} elseif ($response->isAjax() && !empty($_POST['refresh'])) {
|
||||
// Only sends the process list table
|
||||
$response->addHTML(Processes::getHtmlForServerProcesslist());
|
||||
} else {
|
||||
|
||||
@ -18,15 +18,15 @@ require_once 'libraries/replication.inc.php';
|
||||
/**
|
||||
* flush status variables if requested
|
||||
*/
|
||||
if (isset($_REQUEST['flush'])) {
|
||||
if (isset($_POST['flush'])) {
|
||||
$_flush_commands = array(
|
||||
'STATUS',
|
||||
'TABLES',
|
||||
'QUERY CACHE',
|
||||
);
|
||||
|
||||
if (in_array($_REQUEST['flush'], $_flush_commands)) {
|
||||
$GLOBALS['dbi']->query('FLUSH ' . $_REQUEST['flush'] . ';');
|
||||
if (in_array($_POST['flush'], $_flush_commands)) {
|
||||
$GLOBALS['dbi']->query('FLUSH ' . $_POST['flush'] . ';');
|
||||
}
|
||||
unset($_flush_commands);
|
||||
}
|
||||
|
||||
@ -40,35 +40,35 @@ $response->addHTML(Users::getHtmlForSubMenusOnUsersPage('server_user_groups.php'
|
||||
/**
|
||||
* Delete user group
|
||||
*/
|
||||
if (! empty($_REQUEST['deleteUserGroup'])) {
|
||||
UserGroups::delete($_REQUEST['userGroup']);
|
||||
if (! empty($_POST['deleteUserGroup'])) {
|
||||
UserGroups::delete($_POST['userGroup']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new user group
|
||||
*/
|
||||
if (! empty($_REQUEST['addUserGroupSubmit'])) {
|
||||
UserGroups::edit($_REQUEST['userGroup'], true);
|
||||
if (! empty($_POST['addUserGroupSubmit'])) {
|
||||
UserGroups::edit($_POST['userGroup'], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a user group
|
||||
*/
|
||||
if (! empty($_REQUEST['editUserGroupSubmit'])) {
|
||||
UserGroups::edit($_REQUEST['userGroup']);
|
||||
if (! empty($_POST['editUserGroupSubmit'])) {
|
||||
UserGroups::edit($_POST['userGroup']);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['viewUsers'])) {
|
||||
if (isset($_POST['viewUsers'])) {
|
||||
// Display users belonging to a user group
|
||||
$response->addHTML(UserGroups::getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
|
||||
$response->addHTML(UserGroups::getHtmlForListingUsersofAGroup($_POST['userGroup']));
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['addUserGroup'])) {
|
||||
if (isset($_GET['addUserGroup'])) {
|
||||
// Display add user group dialog
|
||||
$response->addHTML(UserGroups::getHtmlToEditUserGroup());
|
||||
} elseif (isset($_REQUEST['editUserGroup'])) {
|
||||
} elseif (isset($_POST['editUserGroup'])) {
|
||||
// Display edit user group dialog
|
||||
$response->addHTML(UserGroups::getHtmlToEditUserGroup($_REQUEST['userGroup']));
|
||||
$response->addHTML(UserGroups::getHtmlToEditUserGroup($_POST['userGroup']));
|
||||
} else {
|
||||
// Display user groups table
|
||||
$response->addHTML(UserGroups::getHtmlForUserGroupsTable());
|
||||
|
||||
14
sql.php
14
sql.php
@ -79,28 +79,28 @@ if (isset($_POST['bkm_fields']['bkm_database'])) {
|
||||
}
|
||||
|
||||
// During grid edit, if we have a relational field, show the dropdown for it.
|
||||
if (isset($_REQUEST['get_relational_values'])
|
||||
&& $_REQUEST['get_relational_values'] == true
|
||||
if (isset($_POST['get_relational_values'])
|
||||
&& $_POST['get_relational_values'] == true
|
||||
) {
|
||||
$sql->getRelationalValues($db, $table);
|
||||
// script has exited at this point
|
||||
}
|
||||
|
||||
// Just like above, find possible values for enum fields during grid edit.
|
||||
if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true) {
|
||||
if (isset($_POST['get_enum_values']) && $_POST['get_enum_values'] == true) {
|
||||
$sql->getEnumOrSetValues($db, $table, "enum");
|
||||
// script has exited at this point
|
||||
}
|
||||
|
||||
|
||||
// Find possible values for set fields during grid edit.
|
||||
if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
|
||||
if (isset($_POST['get_set_values']) && $_POST['get_set_values'] == true) {
|
||||
$sql->getEnumOrSetValues($db, $table, "set");
|
||||
// script has exited at this point
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['get_default_fk_check_value'])
|
||||
&& $_REQUEST['get_default_fk_check_value'] == true
|
||||
if (isset($_GET['get_default_fk_check_value'])
|
||||
&& $_GET['get_default_fk_check_value'] == true
|
||||
) {
|
||||
$response = Response::getInstance();
|
||||
$response->addJSON(
|
||||
@ -112,7 +112,7 @@ if (isset($_REQUEST['get_default_fk_check_value'])
|
||||
/**
|
||||
* Check ajax request to set the column order and visibility
|
||||
*/
|
||||
if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
|
||||
if (isset($_POST['set_col_prefs']) && $_POST['set_col_prefs'] == true) {
|
||||
$sql->setColumnOrderOrVisibility($table, $db);
|
||||
// script has exited at this point
|
||||
}
|
||||
|
||||
@ -41,28 +41,28 @@ $err_url = 'tbl_sql.php' . Url::getCommon(
|
||||
$abort = false;
|
||||
|
||||
// check number of fields to be created
|
||||
if (isset($_REQUEST['submit_num_fields'])) {
|
||||
if (isset($_REQUEST['orig_after_field'])) {
|
||||
$_REQUEST['after_field'] = $_REQUEST['orig_after_field'];
|
||||
if (isset($_POST['submit_num_fields'])) {
|
||||
if (isset($_POST['orig_after_field'])) {
|
||||
$_POST['after_field'] = $_POST['orig_after_field'];
|
||||
}
|
||||
if (isset($_REQUEST['orig_field_where'])) {
|
||||
$_REQUEST['field_where'] = $_REQUEST['orig_field_where'];
|
||||
if (isset($_POST['orig_field_where'])) {
|
||||
$_POST['field_where'] = $_POST['orig_field_where'];
|
||||
}
|
||||
$num_fields = min(
|
||||
intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']),
|
||||
intval($_POST['orig_num_fields']) + intval($_POST['added_fields']),
|
||||
4096
|
||||
);
|
||||
$regenerate = true;
|
||||
} elseif (isset($_REQUEST['num_fields']) && intval($_REQUEST['num_fields']) > 0) {
|
||||
$num_fields = min(4096, intval($_REQUEST['num_fields']));
|
||||
} elseif (isset($_POST['num_fields']) && intval($_POST['num_fields']) > 0) {
|
||||
$num_fields = min(4096, intval($_POST['num_fields']));
|
||||
} else {
|
||||
$num_fields = 1;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['do_save_data'])) {
|
||||
if (isset($_POST['do_save_data'])) {
|
||||
//avoid an incorrect calling of PMA_updateColumns() via
|
||||
//tbl_structure.php below
|
||||
unset($_REQUEST['do_save_data']);
|
||||
unset($_POST['do_save_data']);
|
||||
|
||||
$createAddField = new CreateAddField($GLOBALS['dbi']);
|
||||
|
||||
@ -70,22 +70,22 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
if ($result === true) {
|
||||
// Update comment table for mime types [MIME]
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
if (isset($_POST['field_mimetype'])
|
||||
&& is_array($_POST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']
|
||||
) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex]) > 0
|
||||
foreach ($_POST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_POST['field_name'][$fieldindex])
|
||||
&& strlen($_POST['field_name'][$fieldindex]) > 0
|
||||
) {
|
||||
Transformations::setMIME(
|
||||
$db, $table,
|
||||
$_REQUEST['field_name'][$fieldindex],
|
||||
$_POST['field_name'][$fieldindex],
|
||||
$mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
$_REQUEST['field_transformation_options'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation_options'][$fieldindex]
|
||||
$_POST['field_transformation'][$fieldindex],
|
||||
$_POST['field_transformation_options'][$fieldindex],
|
||||
$_POST['field_input_transformation'][$fieldindex],
|
||||
$_POST['field_input_transformation_options'][$fieldindex]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,11 +61,11 @@ $action = 'tbl_create.php';
|
||||
/**
|
||||
* The form used to define the structure of the table has been submitted
|
||||
*/
|
||||
if (isset($_REQUEST['do_save_data'])) {
|
||||
if (isset($_POST['do_save_data'])) {
|
||||
$sql_query = $createAddField->getTableCreationQuery($db, $table);
|
||||
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
Core::previewSQL($sql_query);
|
||||
}
|
||||
// Executes the query
|
||||
@ -73,21 +73,21 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
if ($result) {
|
||||
// Update comment table for mime types [MIME]
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
if (isset($_POST['field_mimetype'])
|
||||
&& is_array($_POST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']
|
||||
) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex]) > 0
|
||||
foreach ($_POST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_POST['field_name'][$fieldindex])
|
||||
&& strlen($_POST['field_name'][$fieldindex]) > 0
|
||||
) {
|
||||
Transformations::setMIME(
|
||||
$db, $table,
|
||||
$_REQUEST['field_name'][$fieldindex], $mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
$_REQUEST['field_transformation_options'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation'][$fieldindex],
|
||||
$_REQUEST['field_input_transformation_options'][$fieldindex]
|
||||
$_POST['field_name'][$fieldindex], $mimetype,
|
||||
$_POST['field_transformation'][$fieldindex],
|
||||
$_POST['field_transformation_options'][$fieldindex],
|
||||
$_POST['field_input_transformation'][$fieldindex],
|
||||
$_POST['field_input_transformation_options'][$fieldindex]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ $cfgRelation = $relation->getRelationsParam();
|
||||
$displayExport = new Export();
|
||||
|
||||
// handling export template actions
|
||||
if (isset($_REQUEST['templateAction']) && $cfgRelation['exporttemplateswork']) {
|
||||
if (isset($_POST['templateAction']) && $cfgRelation['exporttemplateswork']) {
|
||||
$displayExport->handleTemplateActions($cfgRelation);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -27,15 +27,15 @@ $db = $container->get('db');
|
||||
$table = $container->get('table');
|
||||
$dbi = $container->get('dbi');
|
||||
|
||||
if (!isset($_REQUEST['create_edit_table'])) {
|
||||
if (!isset($_POST['create_edit_table'])) {
|
||||
include_once 'libraries/tbl_common.inc.php';
|
||||
}
|
||||
if (isset($_REQUEST['index'])) {
|
||||
if (is_array($_REQUEST['index'])) {
|
||||
if (isset($_POST['index'])) {
|
||||
if (is_array($_POST['index'])) {
|
||||
// coming already from form
|
||||
$index = new Index($_REQUEST['index']);
|
||||
$index = new Index($_POST['index']);
|
||||
} else {
|
||||
$index = $dbi->getTable($db, $table)->getIndex($_REQUEST['index']);
|
||||
$index = $dbi->getTable($db, $table)->getIndex($_POST['index']);
|
||||
}
|
||||
} else {
|
||||
$index = new Index;
|
||||
|
||||
@ -100,7 +100,7 @@ $operations = new Operations();
|
||||
/**
|
||||
* If the table has to be moved to some other database
|
||||
*/
|
||||
if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
|
||||
if (isset($_POST['submit_move']) || isset($_POST['submit_copy'])) {
|
||||
//$_message = '';
|
||||
$operations->moveOrCopyTable($db, $table);
|
||||
// This was ended in an Ajax call
|
||||
@ -109,28 +109,28 @@ if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
|
||||
/**
|
||||
* If the table has to be maintained
|
||||
*/
|
||||
if (isset($_REQUEST['table_maintenance'])) {
|
||||
if (isset($_POST['table_maintenance'])) {
|
||||
include_once 'sql.php';
|
||||
unset($result);
|
||||
}
|
||||
/**
|
||||
* Updates table comment, type and options if required
|
||||
*/
|
||||
if (isset($_REQUEST['submitoptions'])) {
|
||||
if (isset($_POST['submitoptions'])) {
|
||||
$_message = '';
|
||||
$warning_messages = array();
|
||||
|
||||
if (isset($_REQUEST['new_name'])) {
|
||||
if (isset($_POST['new_name'])) {
|
||||
// Get original names before rename operation
|
||||
$oldTable = $pma_table->getName();
|
||||
$oldDb = $pma_table->getDbName();
|
||||
|
||||
if ($pma_table->rename($_REQUEST['new_name'])) {
|
||||
if (isset($_REQUEST['adjust_privileges'])
|
||||
&& ! empty($_REQUEST['adjust_privileges'])
|
||||
if ($pma_table->rename($_POST['new_name'])) {
|
||||
if (isset($_POST['adjust_privileges'])
|
||||
&& ! empty($_POST['adjust_privileges'])
|
||||
) {
|
||||
$operations->adjustPrivilegesRenameOrMoveTable(
|
||||
$oldDb, $oldTable, $_REQUEST['db'], $_REQUEST['new_name']
|
||||
$oldDb, $oldTable, $_POST['db'], $_POST['new_name']
|
||||
);
|
||||
}
|
||||
|
||||
@ -148,10 +148,10 @@ if (isset($_REQUEST['submitoptions'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['new_tbl_storage_engine'])
|
||||
&& mb_strtoupper($_REQUEST['new_tbl_storage_engine']) !== $tbl_storage_engine
|
||||
if (! empty($_POST['new_tbl_storage_engine'])
|
||||
&& mb_strtoupper($_POST['new_tbl_storage_engine']) !== $tbl_storage_engine
|
||||
) {
|
||||
$new_tbl_storage_engine = mb_strtoupper($_REQUEST['new_tbl_storage_engine']);
|
||||
$new_tbl_storage_engine = mb_strtoupper($_POST['new_tbl_storage_engine']);
|
||||
|
||||
if ($pma_table->isEngine('ARIA')) {
|
||||
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
|
||||
@ -190,28 +190,28 @@ if (isset($_REQUEST['submitoptions'])) {
|
||||
$warning_messages = $operations->getWarningMessagesArray();
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['tbl_collation'])
|
||||
&& ! empty($_REQUEST['tbl_collation'])
|
||||
&& isset($_REQUEST['change_all_collations'])
|
||||
&& ! empty($_REQUEST['change_all_collations'])
|
||||
if (isset($_POST['tbl_collation'])
|
||||
&& ! empty($_POST['tbl_collation'])
|
||||
&& isset($_POST['change_all_collations'])
|
||||
&& ! empty($_POST['change_all_collations'])
|
||||
) {
|
||||
$operations->changeAllColumnsCollation(
|
||||
$GLOBALS['db'], $GLOBALS['table'], $_REQUEST['tbl_collation']
|
||||
$GLOBALS['db'], $GLOBALS['table'], $_POST['tbl_collation']
|
||||
);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Reordering the table has been requested by the user
|
||||
*/
|
||||
if (isset($_REQUEST['submitorderby']) && ! empty($_REQUEST['order_field'])) {
|
||||
if (isset($_POST['submitorderby']) && ! empty($_POST['order_field'])) {
|
||||
list($sql_query, $result) = $operations->getQueryAndResultForReorderingTable();
|
||||
} // end if
|
||||
|
||||
/**
|
||||
* A partition operation has been requested by the user
|
||||
*/
|
||||
if (isset($_REQUEST['submit_partition'])
|
||||
&& ! empty($_REQUEST['partition_operation'])
|
||||
if (isset($_POST['submit_partition'])
|
||||
&& ! empty($_POST['partition_operation'])
|
||||
) {
|
||||
list($sql_query, $result) = $operations->getQueryAndResultForPartition();
|
||||
} // end if
|
||||
|
||||
@ -55,15 +55,15 @@ $insertEdit = new InsertEdit($GLOBALS['dbi']);
|
||||
$insertEdit->isInsertRow();
|
||||
|
||||
$after_insert_actions = array('new_insert', 'same_insert', 'edit_next');
|
||||
if (isset($_REQUEST['after_insert'])
|
||||
&& in_array($_REQUEST['after_insert'], $after_insert_actions)
|
||||
if (isset($_POST['after_insert'])
|
||||
&& in_array($_POST['after_insert'], $after_insert_actions)
|
||||
) {
|
||||
$url_params['after_insert'] = $_REQUEST['after_insert'];
|
||||
if (isset($_REQUEST['where_clause'])) {
|
||||
foreach ($_REQUEST['where_clause'] as $one_where_clause) {
|
||||
if ($_REQUEST['after_insert'] == 'same_insert') {
|
||||
$url_params['after_insert'] = $_POST['after_insert'];
|
||||
if (isset($_POST['where_clause'])) {
|
||||
foreach ($_POST['where_clause'] as $one_where_clause) {
|
||||
if ($_POST['after_insert'] == 'same_insert') {
|
||||
$url_params['where_clause'][] = $one_where_clause;
|
||||
} elseif ($_REQUEST['after_insert'] == 'edit_next') {
|
||||
} elseif ($_POST['after_insert'] == 'edit_next') {
|
||||
$insertEdit->setSessionForEditNext($one_where_clause);
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,7 @@ $row_skipped = false;
|
||||
$unsaved_values = array();
|
||||
foreach ($loop_array as $rownumber => $where_clause) {
|
||||
// skip fields to be ignored
|
||||
if (! $using_key && isset($_REQUEST['insert_ignore_' . $where_clause])) {
|
||||
if (! $using_key && isset($_POST['insert_ignore_' . $where_clause])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -153,47 +153,47 @@ foreach ($loop_array as $rownumber => $where_clause) {
|
||||
|
||||
// Map multi-edit keys to single-level arrays, dependent on how we got the fields
|
||||
$multi_edit_columns
|
||||
= isset($_REQUEST['fields']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields']['multi_edit'][$rownumber])
|
||||
? $_POST['fields']['multi_edit'][$rownumber]
|
||||
: array();
|
||||
$multi_edit_columns_name
|
||||
= isset($_REQUEST['fields_name']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields_name']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields_name']['multi_edit'][$rownumber])
|
||||
? $_POST['fields_name']['multi_edit'][$rownumber]
|
||||
: array();
|
||||
$multi_edit_columns_prev
|
||||
= isset($_REQUEST['fields_prev']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields_prev']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields_prev']['multi_edit'][$rownumber])
|
||||
? $_POST['fields_prev']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_funcs
|
||||
= isset($_REQUEST['funcs']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['funcs']['multi_edit'][$rownumber]
|
||||
= isset($_POST['funcs']['multi_edit'][$rownumber])
|
||||
? $_POST['funcs']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_salt
|
||||
= isset($_REQUEST['salt']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['salt']['multi_edit'][$rownumber]
|
||||
= isset($_POST['salt']['multi_edit'][$rownumber])
|
||||
? $_POST['salt']['multi_edit'][$rownumber]
|
||||
:null;
|
||||
$multi_edit_columns_type
|
||||
= isset($_REQUEST['fields_type']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields_type']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields_type']['multi_edit'][$rownumber])
|
||||
? $_POST['fields_type']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_columns_null
|
||||
= isset($_REQUEST['fields_null']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields_null']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields_null']['multi_edit'][$rownumber])
|
||||
? $_POST['fields_null']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_columns_null_prev
|
||||
= isset($_REQUEST['fields_null_prev']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['fields_null_prev']['multi_edit'][$rownumber]
|
||||
= isset($_POST['fields_null_prev']['multi_edit'][$rownumber])
|
||||
? $_POST['fields_null_prev']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_auto_increment
|
||||
= isset($_REQUEST['auto_increment']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['auto_increment']['multi_edit'][$rownumber]
|
||||
= isset($_POST['auto_increment']['multi_edit'][$rownumber])
|
||||
? $_POST['auto_increment']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
$multi_edit_virtual
|
||||
= isset($_REQUEST['virtual']['multi_edit'][$rownumber])
|
||||
? $_REQUEST['virtual']['multi_edit'][$rownumber]
|
||||
= isset($_POST['virtual']['multi_edit'][$rownumber])
|
||||
? $_POST['virtual']['multi_edit'][$rownumber]
|
||||
: null;
|
||||
|
||||
// When a select field is nullified, it's not present in $_REQUEST
|
||||
// When a select field is nullified, it's not present in $_POST
|
||||
// so initialize it; this way, the foreach($multi_edit_columns) will process it
|
||||
foreach ($multi_edit_columns_name as $key => $val) {
|
||||
if (! isset($multi_edit_columns[$key])) {
|
||||
@ -298,7 +298,7 @@ foreach ($loop_array as $rownumber => $where_clause) {
|
||||
$query[] = 'UPDATE ' . Util::backquote($GLOBALS['table'])
|
||||
. ' SET ' . implode(', ', $query_values)
|
||||
. ' WHERE ' . $where_clause
|
||||
. ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1');
|
||||
. ($_POST['clause_is_unique'] ? '' : ' LIMIT 1');
|
||||
}
|
||||
}
|
||||
} // end foreach ($loop_array as $where_clause)
|
||||
@ -313,7 +313,7 @@ unset(
|
||||
// Builds the sql query
|
||||
if ($is_insert && count($value_sets) > 0) {
|
||||
$query = $insertEdit->buildSqlQuery($is_insertignore, $query_fields, $value_sets);
|
||||
} elseif (empty($query) && ! isset($_REQUEST['preview_sql']) && !$row_skipped) {
|
||||
} elseif (empty($query) && ! isset($_POST['preview_sql']) && !$row_skipped) {
|
||||
// No change -> move back to the calling script
|
||||
//
|
||||
// Note: logic passes here for inline edit
|
||||
@ -329,7 +329,7 @@ if ($is_insert && count($value_sets) > 0) {
|
||||
unset($multi_edit_columns, $is_insertignore);
|
||||
|
||||
// If there is a request for SQL previewing.
|
||||
if (isset($_REQUEST['preview_sql'])) {
|
||||
if (isset($_POST['preview_sql'])) {
|
||||
Core::previewSQL($query);
|
||||
}
|
||||
|
||||
@ -384,12 +384,12 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
|
||||
* transformed fields, if they were edited. After that, output the correct
|
||||
* link/transformed value and exit
|
||||
*/
|
||||
if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') {
|
||||
if (isset($_POST['rel_fields_list']) && $_POST['rel_fields_list'] != '') {
|
||||
|
||||
$map = $relation->getForeigners($db, $table, '', 'both');
|
||||
|
||||
$relation_fields = array();
|
||||
parse_str($_REQUEST['rel_fields_list'], $relation_fields);
|
||||
parse_str($_POST['rel_fields_list'], $relation_fields);
|
||||
|
||||
// loop for each relation cell
|
||||
/** @var array $relation_fields */
|
||||
@ -408,11 +408,11 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
|
||||
}
|
||||
} // end of loop for each relation cell
|
||||
}
|
||||
if (isset($_REQUEST['do_transformations'])
|
||||
&& $_REQUEST['do_transformations'] == true
|
||||
if (isset($_POST['do_transformations'])
|
||||
&& $_POST['do_transformations'] == true
|
||||
) {
|
||||
$edited_values = array();
|
||||
parse_str($_REQUEST['transform_fields_list'], $edited_values);
|
||||
parse_str($_POST['transform_fields_list'], $edited_values);
|
||||
|
||||
if (! isset($extra_data)) {
|
||||
$extra_data = array();
|
||||
@ -435,14 +435,14 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
|
||||
|
||||
// Need to check the inline edited value can be truncated by MySQL
|
||||
// without informing while saving
|
||||
$column_name = $_REQUEST['fields_name']['multi_edit'][0][0];
|
||||
$column_name = $_POST['fields_name']['multi_edit'][0][0];
|
||||
|
||||
$insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData(
|
||||
$db, $table, $column_name, $extra_data
|
||||
);
|
||||
|
||||
/**Get the total row count of the table*/
|
||||
$_table = new Table($_REQUEST['table'], $_REQUEST['db']);
|
||||
$_table = new Table($_POST['table'], $_POST['db']);
|
||||
$extra_data['row_count'] = $_table->countRecords();
|
||||
|
||||
$extra_data['sql_query'] = Util::getMessage(
|
||||
@ -473,8 +473,8 @@ $active_page = $goto_include;
|
||||
* WHERE clause information so that tbl_change.php does not go back
|
||||
* to the current record
|
||||
*/
|
||||
if (isset($_REQUEST['after_insert']) && 'new_insert' == $_REQUEST['after_insert']) {
|
||||
unset($_REQUEST['where_clause']);
|
||||
if (isset($_POST['after_insert']) && 'new_insert' == $_POST['after_insert']) {
|
||||
unset($_POST['where_clause']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -15,20 +15,20 @@ use PhpMyAdmin\Url;
|
||||
*/
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
if (isset($_REQUEST['submit_mult'])) {
|
||||
$submit_mult = $_REQUEST['submit_mult'];
|
||||
if (isset($_POST['submit_mult'])) {
|
||||
$submit_mult = $_POST['submit_mult'];
|
||||
// workaround for IE problem:
|
||||
} elseif (isset($_REQUEST['submit_mult_delete_x'])) {
|
||||
} elseif (isset($_POST['submit_mult_delete_x'])) {
|
||||
$submit_mult = 'row_delete';
|
||||
} elseif (isset($_REQUEST['submit_mult_change_x'])) {
|
||||
} elseif (isset($_POST['submit_mult_change_x'])) {
|
||||
$submit_mult = 'row_edit';
|
||||
} elseif (isset($_REQUEST['submit_mult_export_x'])) {
|
||||
} elseif (isset($_POST['submit_mult_export_x'])) {
|
||||
$submit_mult = 'row_export';
|
||||
}
|
||||
|
||||
// If the 'Ask for confirmation' button was pressed, this can only come
|
||||
// from 'delete' mode, so we set it straight away.
|
||||
if (isset($_REQUEST['mult_btn'])) {
|
||||
if (isset($_POST['mult_btn'])) {
|
||||
$submit_mult = 'row_delete';
|
||||
}
|
||||
|
||||
@ -64,9 +64,9 @@ default:
|
||||
|
||||
if (!empty($submit_mult)) {
|
||||
|
||||
if (isset($_REQUEST['goto'])
|
||||
&& (! isset($_REQUEST['rows_to_delete'])
|
||||
|| ! is_array($_REQUEST['rows_to_delete']))
|
||||
if (isset($_POST['goto'])
|
||||
&& (! isset($_POST['rows_to_delete'])
|
||||
|| ! is_array($_POST['rows_to_delete']))
|
||||
) {
|
||||
$response = Response::getInstance();
|
||||
$response->setRequestStatus(false);
|
||||
@ -76,7 +76,7 @@ if (!empty($submit_mult)) {
|
||||
switch($submit_mult) {
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case 'row_copy':
|
||||
$_REQUEST['default_action'] = 'insert';
|
||||
$_POST['default_action'] = 'insert';
|
||||
// no break to allow for fallthough
|
||||
case 'row_edit':
|
||||
// As we got the rows to be edited from the
|
||||
@ -84,10 +84,10 @@ if (!empty($submit_mult)) {
|
||||
// indicating WHERE clause. Then we build the array which is used
|
||||
// for the tbl_change.php script.
|
||||
$where_clause = array();
|
||||
if (isset($_REQUEST['rows_to_delete'])
|
||||
&& is_array($_REQUEST['rows_to_delete'])
|
||||
if (isset($_POST['rows_to_delete'])
|
||||
&& is_array($_POST['rows_to_delete'])
|
||||
) {
|
||||
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
|
||||
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
|
||||
$where_clause[] = $i_where_clause;
|
||||
}
|
||||
}
|
||||
@ -104,10 +104,10 @@ if (!empty($submit_mult)) {
|
||||
// indicating WHERE clause. Then we build the array which is used
|
||||
// for the tbl_change.php script.
|
||||
$where_clause = array();
|
||||
if (isset($_REQUEST['rows_to_delete'])
|
||||
&& is_array($_REQUEST['rows_to_delete'])
|
||||
if (isset($_POST['rows_to_delete'])
|
||||
&& is_array($_POST['rows_to_delete'])
|
||||
) {
|
||||
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
|
||||
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
|
||||
$where_clause[] = $i_where_clause;
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ if (!empty($submit_mult)) {
|
||||
$action = 'tbl_row_action.php';
|
||||
$err_url = 'tbl_row_action.php'
|
||||
. Url::getCommon($GLOBALS['url_params']);
|
||||
if (! isset($_REQUEST['mult_btn'])) {
|
||||
if (! isset($_POST['mult_btn'])) {
|
||||
$original_sql_query = $sql_query;
|
||||
if (! empty($url_query)) {
|
||||
$original_url_query = $url_query;
|
||||
@ -136,7 +136,7 @@ if (!empty($submit_mult)) {
|
||||
* Show result of multi submit operation
|
||||
*/
|
||||
// sql_query is not set when user does not confirm multi-delete
|
||||
if ((! empty($submit_mult) || isset($_REQUEST['mult_btn']))
|
||||
if ((! empty($submit_mult) || isset($_POST['mult_btn']))
|
||||
&& ! empty($sql_query)
|
||||
) {
|
||||
$disp_message = __('Your SQL query has been executed successfully.');
|
||||
|
||||
@ -41,8 +41,8 @@ $back = 'tbl_sql.php';
|
||||
$response->addHTML(
|
||||
SqlQueryForm::getHtml(
|
||||
true, false,
|
||||
isset($_REQUEST['delimiter'])
|
||||
? htmlspecialchars($_REQUEST['delimiter'])
|
||||
isset($_POST['delimiter'])
|
||||
? htmlspecialchars($_POST['delimiter'])
|
||||
: ';'
|
||||
)
|
||||
);
|
||||
|
||||
@ -24,10 +24,10 @@ require './libraries/tbl_common.inc.php';
|
||||
|
||||
if (Tracker::isActive()
|
||||
&& Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])
|
||||
&& ! (isset($_REQUEST['toggle_activation'])
|
||||
&& $_REQUEST['toggle_activation'] == 'deactivate_now')
|
||||
&& ! (isset($_REQUEST['report_export'])
|
||||
&& $_REQUEST['export_type'] == 'sqldumpfile')
|
||||
&& ! (isset($_POST['toggle_activation'])
|
||||
&& $_POST['toggle_activation'] == 'deactivate_now')
|
||||
&& ! (isset($_POST['report_export'])
|
||||
&& $_POST['export_type'] == 'sqldumpfile')
|
||||
) {
|
||||
$msg = Message::notice(
|
||||
sprintf(
|
||||
@ -43,47 +43,47 @@ $url_params['goto'] = 'tbl_tracking.php';
|
||||
$url_params['back'] = 'tbl_tracking.php';
|
||||
|
||||
// Init vars for tracking report
|
||||
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
|
||||
if (isset($_POST['report']) || isset($_POST['report_export'])) {
|
||||
$data = Tracker::getTrackedData(
|
||||
$_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']
|
||||
$GLOBALS['db'], $GLOBALS['table'], $_POST['version']
|
||||
);
|
||||
|
||||
$selection_schema = false;
|
||||
$selection_data = false;
|
||||
$selection_both = false;
|
||||
|
||||
if (! isset($_REQUEST['logtype'])) {
|
||||
$_REQUEST['logtype'] = 'schema_and_data';
|
||||
if (! isset($_POST['logtype'])) {
|
||||
$_POST['logtype'] = 'schema_and_data';
|
||||
}
|
||||
if ($_REQUEST['logtype'] == 'schema') {
|
||||
if ($_POST['logtype'] == 'schema') {
|
||||
$selection_schema = true;
|
||||
} elseif ($_REQUEST['logtype'] == 'data') {
|
||||
} elseif ($_POST['logtype'] == 'data') {
|
||||
$selection_data = true;
|
||||
} else {
|
||||
$selection_both = true;
|
||||
}
|
||||
if (! isset($_REQUEST['date_from'])) {
|
||||
$_REQUEST['date_from'] = $data['date_from'];
|
||||
if (! isset($_POST['date_from'])) {
|
||||
$_POST['date_from'] = $data['date_from'];
|
||||
}
|
||||
if (! isset($_REQUEST['date_to'])) {
|
||||
$_REQUEST['date_to'] = $data['date_to'];
|
||||
if (! isset($_POST['date_to'])) {
|
||||
$_POST['date_to'] = $data['date_to'];
|
||||
}
|
||||
if (! isset($_REQUEST['users'])) {
|
||||
$_REQUEST['users'] = '*';
|
||||
if (! isset($_POST['users'])) {
|
||||
$_POST['users'] = '*';
|
||||
}
|
||||
$filter_ts_from = strtotime($_REQUEST['date_from']);
|
||||
$filter_ts_to = strtotime($_REQUEST['date_to']);
|
||||
$filter_users = array_map('trim', explode(',', $_REQUEST['users']));
|
||||
$filter_ts_from = strtotime($_POST['date_from']);
|
||||
$filter_ts_to = strtotime($_POST['date_to']);
|
||||
$filter_users = array_map('trim', explode(',', $_POST['users']));
|
||||
}
|
||||
|
||||
// Prepare export
|
||||
if (isset($_REQUEST['report_export'])) {
|
||||
if (isset($_POST['report_export'])) {
|
||||
$entries = Tracking::getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users);
|
||||
}
|
||||
|
||||
// Export as file download
|
||||
if (isset($_REQUEST['report_export'])
|
||||
&& $_REQUEST['export_type'] == 'sqldumpfile'
|
||||
if (isset($_POST['report_export'])
|
||||
&& $_POST['export_type'] == 'sqldumpfile'
|
||||
) {
|
||||
Tracking::exportAsFileDownload($entries);
|
||||
}
|
||||
@ -93,10 +93,10 @@ $html = '<br />';
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
if (isset($_REQUEST['submit_mult'])) {
|
||||
if (! empty($_REQUEST['selected_versions'])) {
|
||||
if ($_REQUEST['submit_mult'] == 'delete_version') {
|
||||
foreach ($_REQUEST['selected_versions'] as $version) {
|
||||
if (isset($_POST['submit_mult'])) {
|
||||
if (! empty($_POST['selected_versions'])) {
|
||||
if ($_POST['submit_mult'] == 'delete_version') {
|
||||
foreach ($_POST['selected_versions'] as $version) {
|
||||
Tracking::deleteTrackingVersion($version);
|
||||
}
|
||||
$html .= Message::success(
|
||||
@ -110,45 +110,45 @@ if (isset($_REQUEST['submit_mult'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['submit_delete_version'])) {
|
||||
$html .= Tracking::deleteTrackingVersion($_REQUEST['version']);
|
||||
if (isset($_POST['submit_delete_version'])) {
|
||||
$html .= Tracking::deleteTrackingVersion($_POST['version']);
|
||||
}
|
||||
|
||||
// Create tracking version
|
||||
if (isset($_REQUEST['submit_create_version'])) {
|
||||
if (isset($_POST['submit_create_version'])) {
|
||||
$html .= Tracking::createTrackingVersion();
|
||||
}
|
||||
|
||||
// Deactivate tracking
|
||||
if (isset($_REQUEST['toggle_activation'])
|
||||
&& $_REQUEST['toggle_activation'] == 'deactivate_now'
|
||||
if (isset($_POST['toggle_activation'])
|
||||
&& $_POST['toggle_activation'] == 'deactivate_now'
|
||||
) {
|
||||
$html .= Tracking::changeTracking('deactivate');
|
||||
}
|
||||
|
||||
// Activate tracking
|
||||
if (isset($_REQUEST['toggle_activation'])
|
||||
&& $_REQUEST['toggle_activation'] == 'activate_now'
|
||||
if (isset($_POST['toggle_activation'])
|
||||
&& $_POST['toggle_activation'] == 'activate_now'
|
||||
) {
|
||||
$html .= Tracking::changeTracking('activate');
|
||||
}
|
||||
|
||||
// Export as SQL execution
|
||||
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'execution') {
|
||||
if (isset($_POST['report_export']) && $_POST['export_type'] == 'execution') {
|
||||
$sql_result = Tracking::exportAsSqlExecution($entries);
|
||||
$msg = Message::success(__('SQL statements executed.'));
|
||||
$html .= $msg->getDisplay();
|
||||
}
|
||||
|
||||
// Export as SQL dump
|
||||
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldump') {
|
||||
if (isset($_POST['report_export']) && $_POST['export_type'] == 'sqldump') {
|
||||
$html .= Tracking::exportAsSqlDump($entries);
|
||||
}
|
||||
|
||||
/*
|
||||
* Schema snapshot
|
||||
*/
|
||||
if (isset($_REQUEST['snapshot'])) {
|
||||
if (isset($_POST['snapshot'])) {
|
||||
$html .= Tracking::getHtmlForSchemaSnapshot($url_query);
|
||||
}
|
||||
// end of snapshot report
|
||||
@ -156,20 +156,19 @@ if (isset($_REQUEST['snapshot'])) {
|
||||
/*
|
||||
* Tracking report
|
||||
*/
|
||||
if (isset($_REQUEST['report'])
|
||||
&& (isset($_REQUEST['delete_ddlog']) || isset($_REQUEST['delete_dmlog']))
|
||||
if (isset($_POST['report'])
|
||||
&& (isset($_POST['delete_ddlog']) || isset($_POST['delete_dmlog']))
|
||||
) {
|
||||
$html .= Tracking::deleteTrackingReportRows($data);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
|
||||
if (isset($_POST['report']) || isset($_POST['report_export'])) {
|
||||
$html .= Tracking::getHtmlForTrackingReport(
|
||||
$url_query, $data, $url_params, $selection_schema, $selection_data,
|
||||
$selection_both, $filter_ts_to, $filter_ts_from, $filter_users
|
||||
);
|
||||
} // end of report
|
||||
|
||||
|
||||
/*
|
||||
* List selectable tables
|
||||
*/
|
||||
|
||||
@ -43,25 +43,47 @@
|
||||
{{ version.status_button|raw }}
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete_tracking_anchor ajax"
|
||||
href="db_tracking.php{{ url_query|raw }}&table=
|
||||
{{- version.table_name }}&delete_tracking=true">
|
||||
<a class="delete_tracking_anchor ajax" href="db_tracking.php" data-post="
|
||||
{{- Url_getCommon({
|
||||
'db': db,
|
||||
'goto': 'tbl_tracking.php',
|
||||
'back': 'db_tracking.php',
|
||||
'table': version.table_name,
|
||||
'delete_tracking': true
|
||||
}, '') }}">
|
||||
{{ Util_getIcon('b_drop', 'Delete tracking'|trans) }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="tbl_tracking.php{{ url_query|raw }}&table=
|
||||
{{- version.table_name }}">
|
||||
<a href="tbl_tracking.php" data-post="
|
||||
{{- Url_getCommon({
|
||||
'db': db,
|
||||
'goto': 'tbl_tracking.php',
|
||||
'back': 'db_tracking.php',
|
||||
'table': version.table_name
|
||||
}, '') }}">
|
||||
{{ Util_getIcon('b_versions', 'Versions'|trans) }}
|
||||
</a>
|
||||
<a href="tbl_tracking.php{{ url_query|raw }}&table=
|
||||
{{- version.table_name }}&report=true&version=
|
||||
{{- version.version }}">
|
||||
<a href="tbl_tracking.php" data-post="
|
||||
{{- Url_getCommon({
|
||||
'db': db,
|
||||
'goto': 'tbl_tracking.php',
|
||||
'back': 'db_tracking.php',
|
||||
'table': version.table_name,
|
||||
'report': true,
|
||||
'version': version.version
|
||||
}, '') }}">
|
||||
{{ Util_getIcon('b_report', 'Tracking report'|trans) }}
|
||||
</a>
|
||||
<a href="tbl_tracking.php{{ url_query|raw }}&table=
|
||||
{{- version.table_name }}&snapshot=true&version=
|
||||
{{- version.version }}">
|
||||
<a href="tbl_tracking.php" data-post="
|
||||
{{- Url_getCommon({
|
||||
'db': db,
|
||||
'goto': 'tbl_tracking.php',
|
||||
'back': 'db_tracking.php',
|
||||
'table': version.table_name,
|
||||
'snapshot': true,
|
||||
'version': version.version
|
||||
}, '') }}">
|
||||
{{ Util_getIcon('b_props', 'Structure snapshot'|trans) }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<form action="server_binlog.php" method="get">
|
||||
<form action="server_binlog.php" method="post">
|
||||
{{ Url_getHiddenInputs(url_params) }}
|
||||
<fieldset>
|
||||
<legend>
|
||||
|
||||
@ -20,11 +20,10 @@
|
||||
{% if criteria_values[column_index] is defined %}
|
||||
value="{{ criteria_values[column_index] }}"
|
||||
{% endif %} />
|
||||
<a class="ajax browse_foreign"
|
||||
href="browse_foreigners.php
|
||||
{{- Url_getCommon({'db': db, 'table': table}) -}}
|
||||
&field={{ column_name|url_encode }}&fieldkey=
|
||||
{{- column_index }}&fromsearch=1">
|
||||
<a class="ajax browse_foreign" href="browse_foreigners.php" data-post="
|
||||
{{- Url_getCommon({'db': db, 'table': table}, '') -}}
|
||||
&field={{ column_name|url_encode }}&fieldkey=
|
||||
{{- column_index }}&fromsearch=1">
|
||||
{{ titles['Browse']|replace({"'": "\\'"})|raw }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<td><small>{{ entry.username }}</small></td>
|
||||
<td>{{ entry.formated_statement|raw }}</td>
|
||||
<td class="nowrap">
|
||||
<a class="delete_entry_anchor ajax" href="tbl_tracking.php
|
||||
<a class="delete_entry_anchor ajax" href="tbl_tracking.php" data-post="
|
||||
{{- entry.url_params|raw }}">
|
||||
{{ drop_image_or_text|raw }}
|
||||
</a>
|
||||
|
||||
@ -66,7 +66,7 @@ class BrowseForeignersTest extends TestCase
|
||||
$this->browseForeigners->getForeignLimit(null)
|
||||
);
|
||||
|
||||
$_REQUEST['pos'] = 10;
|
||||
$_POST['pos'] = 10;
|
||||
|
||||
$this->assertEquals(
|
||||
'LIMIT 10, 25 ',
|
||||
@ -107,7 +107,7 @@ class BrowseForeignersTest extends TestCase
|
||||
)
|
||||
);
|
||||
|
||||
$_REQUEST['pos'] = 15;
|
||||
$_POST['pos'] = 15;
|
||||
$foreignData = array();
|
||||
$foreignData['disp_row'] = array();
|
||||
$foreignData['the_total'] = 5;
|
||||
@ -196,8 +196,8 @@ class BrowseForeignersTest extends TestCase
|
||||
$foreignData['disp_row'] = '';
|
||||
$fieldkey = 'bar';
|
||||
$current_value = '';
|
||||
$_REQUEST['rownumber'] = 1;
|
||||
$_REQUEST['foreign_filter'] = '5';
|
||||
$_POST['rownumber'] = 1;
|
||||
$_POST['foreign_filter'] = '5';
|
||||
$result = $this->browseForeigners->getHtmlForRelationalFieldSelection(
|
||||
$db,
|
||||
$table,
|
||||
|
||||
@ -227,8 +227,8 @@ class CentralColumnsTest extends TestCase
|
||||
*/
|
||||
public function testSyncUniqueColumns()
|
||||
{
|
||||
$_REQUEST['db'] = 'PMA_db';
|
||||
$_REQUEST['table'] = 'PMA_table';
|
||||
$_POST['db'] = 'PMA_db';
|
||||
$_POST['table'] = 'PMA_table';
|
||||
|
||||
$this->assertTrue(
|
||||
$this->centralColumns->syncUniqueColumns(
|
||||
@ -244,8 +244,8 @@ class CentralColumnsTest extends TestCase
|
||||
*/
|
||||
public function testDeleteColumnsFromList()
|
||||
{
|
||||
$_REQUEST['db'] = 'PMA_db';
|
||||
$_REQUEST['table'] = 'PMA_table';
|
||||
$_POST['db'] = 'PMA_db';
|
||||
$_POST['table'] = 'PMA_table';
|
||||
|
||||
// when column exists in the central column list
|
||||
$GLOBALS['dbi']->expects($this->at(4))
|
||||
|
||||
@ -29,9 +29,9 @@ class ServerBinlogControllerTest extends PmaTestCase
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
//$_REQUEST
|
||||
$_REQUEST['log'] = "index1";
|
||||
$_REQUEST['pos'] = 3;
|
||||
//$_POST
|
||||
$_POST['log'] = "index1";
|
||||
$_POST['pos'] = 3;
|
||||
|
||||
//$GLOBALS
|
||||
$GLOBALS['cfg']['MaxRows'] = 10;
|
||||
@ -193,7 +193,7 @@ class ServerBinlogControllerTest extends PmaTestCase
|
||||
$html
|
||||
);
|
||||
//validate 4: PMA_getNavigationRow is right
|
||||
$urlNavigation = 'server_binlog.php?log=log&dontlimitchars=1&'
|
||||
$urlNavigation = 'server_binlog.php" data-post="log=log&dontlimitchars=1&'
|
||||
. 'pos=3&server=1&';
|
||||
$this->assertContains(
|
||||
$urlNavigation,
|
||||
|
||||
@ -111,7 +111,7 @@ class TableIndexesControllerTest extends PmaTestCase
|
||||
);
|
||||
|
||||
// Preview SQL
|
||||
$_REQUEST['preview_sql'] = true;
|
||||
$_POST['preview_sql'] = true;
|
||||
$ctrl->doSaveDataAction();
|
||||
$jsonArray = $response->getJSONResult();
|
||||
$this->assertArrayHasKey('sql_data', $jsonArray);
|
||||
@ -123,7 +123,7 @@ class TableIndexesControllerTest extends PmaTestCase
|
||||
// Alter success
|
||||
$response->clear();
|
||||
Response::getInstance()->setAjax(true);
|
||||
unset($_REQUEST['preview_sql']);
|
||||
unset($_POST['preview_sql']);
|
||||
$ctrl->doSaveDataAction();
|
||||
$jsonArray = $response->getJSONResult();
|
||||
$this->assertArrayHasKey('index_table', $jsonArray);
|
||||
@ -169,8 +169,8 @@ class TableIndexesControllerTest extends PmaTestCase
|
||||
$index
|
||||
);
|
||||
|
||||
$_REQUEST['create_index'] = true;
|
||||
$_REQUEST['added_fields'] = 3;
|
||||
$_POST['create_index'] = true;
|
||||
$_POST['added_fields'] = 3;
|
||||
$ctrl->displayFormAction();
|
||||
$html = $response->getHTMLResult();
|
||||
|
||||
|
||||
@ -36,8 +36,8 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
//$_SESSION
|
||||
|
||||
$_REQUEST['foreignDb'] = 'db';
|
||||
$_REQUEST['foreignTable'] = 'table';
|
||||
$_POST['foreignDb'] = 'db';
|
||||
$_POST['foreignTable'] = 'table';
|
||||
|
||||
$GLOBALS['dblist'] = new DataBasePMAMockForTblRelation();
|
||||
$GLOBALS['dblist']->databases = new DataBaseMockForTblRelation();
|
||||
@ -202,7 +202,7 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
array('tbl_storage_engine' => 'INNODB')
|
||||
);
|
||||
|
||||
$_REQUEST['foreign'] = 'true';
|
||||
$_POST['foreign'] = 'true';
|
||||
$ctrl->getDropdownValueForDbAction();
|
||||
$json = $this->_response->getJSONResult();
|
||||
$this->assertEquals(
|
||||
@ -248,7 +248,7 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
array('tbl_storage_engine' => 'INNODB',)
|
||||
);
|
||||
|
||||
$_REQUEST['foreign'] = 'false';
|
||||
$_POST['foreign'] = 'false';
|
||||
$ctrl->getDropdownValueForDbAction();
|
||||
$json = $this->_response->getJSONResult();
|
||||
$this->assertEquals(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user