array to string conversion (sorry to late :-( ), use of $_REQUEST

This commit is contained in:
Sebastian Mendel
2006-02-05 10:22:48 +00:00
parent 7e93c28871
commit a38d7c05d0
3 changed files with 32 additions and 24 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2006-02-05 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/mult_submits.inc.php, server_databases.php: array to string
conversion (sorry to late :-( ), use of $_REQUEST
2006-02-04 Marc Delisle <lem9@users.sourceforge.net>
* libraries/Config.class.php: bug #1409770 auto-detection and dirname on
Windows, thanks to Alex - nixniemand

View File

@@ -8,16 +8,16 @@
*/
if (!empty($submit_mult)
&& ($submit_mult != $strWithChecked)
&& ( ( isset($selected_db) && (is_array($selected_db) || strlen($selected_db)))
|| ( isset($selected_tbl) && (is_array($selected_tbl) || strlen($selected_tbl)))
|| ( isset($selected_fld) && (is_array($selected_fld) || strlen($selected_fld)))
&& ( ( isset($selected_db) && !empty($selected_db) )
|| ( isset($selected_tbl) && !empty($selected_tbl) )
|| ( isset($selected_fld) && !empty($selected_fld) )
|| !empty($rows_to_delete)
)) {
if (isset($selected_db) && (is_array($selected_db) || strlen($selected_db))) {
if (isset($selected_db) && !empty($selected_db)) {
$selected = $selected_db;
$what = 'drop_db';
} elseif (isset($selected_tbl) && (is_array($selected_tbl) || strlen($selected_tbl))) {
} elseif (isset($selected_tbl) && !empty($selected_tbl)) {
if ($submit_mult == $strPrintView) {
require('./tbl_printview.php');
} else {
@@ -54,7 +54,7 @@ if (!empty($submit_mult)
break;
} // end switch
}
} elseif (isset($selected_fld) && (is_array($selected_fld) || strlen($selected_fld))) {
} elseif (isset($selected_fld) && !empty($selected_fld)) {
$selected = $selected_fld;
switch ($submit_mult) {
case $strDrop:

View File

@@ -5,11 +5,11 @@
/**
* Does the common work
*/
require_once('./libraries/common.lib.php');
require_once './libraries/common.lib.php';
$js_to_run = 'functions.js';
require('./libraries/server_common.inc.php');
require './libraries/server_common.inc.php';
/**
* Sorts the databases array according to the user's choice
@@ -45,22 +45,22 @@ function PMA_dbCmp($a, $b) {
/**
* avoids 'undefined index' errors
*/
if (empty($sort_by)) {
if (empty($_REQUEST['sort_by'])) {
$sort_by = 'SCHEMA_NAME';
} else {
$sort_by = PMA_sanitize($sort_by);
$sort_by = PMA_sanitize($_REQUEST['sort_by']);
}
if (empty($sort_order)) {
if (empty($_REQUEST['sort_order'])) {
if ($sort_by == 'SCHEMA_NAME') {
$sort_order = 'asc';
} else {
$sort_order = 'desc';
}
} else {
$sort_order = PMA_sanitize($sort_order);
$sort_order = PMA_sanitize($_REQUEST['sort_order']);
}
$dbstats = empty( $dbstats ) ? 0 : 1;
$dbstats = empty($dbstats) ? 0 : 1;
/**
@@ -69,19 +69,23 @@ $dbstats = empty( $dbstats ) ? 0 : 1;
// workaround for IE behavior (it returns some coordinates based on where
// the mouse was on the Drop image):
if (isset($drop_selected_dbs_x)) {
$drop_selected_dbs = 'Drop';
if (isset($_REQUEST['drop_selected_dbs_x'])) {
$_REQUEST['drop_selected_dbs'] = true;
}
if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg['AllowUserDropDatabase'])) {
if (! isset($selected_db) && ! isset($query_type)) {
if ((isset($_REQUEST['drop_selected_dbs']) || isset($_REQUEST['query_type']))
&& ($is_superuser || $cfg['AllowUserDropDatabase'])) {
if (! isset($_REQUEST['selected_dbs']) && ! isset($_REQUEST['query_type'])) {
$message = $strNoDatabasesSelected;
} else {
$action = 'server_databases.php';
$submit_mult = 'drop_db' ;
$err_url = 'server_databases.php?' . PMA_generate_common_url();
require('./libraries/mult_submits.inc.php');
if (isset($_REQUEST['selected_dbs'])) {
$selected_db = $_REQUEST['selected_dbs'];
}
require './libraries/mult_submits.inc.php';
unset($action, $submit_mult, $err_url, $selected_db);
if ($mult_btn == $strYes) {
$message = sprintf($strDatabasesDropped, count($selected));
} else {
@@ -93,7 +97,7 @@ if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg
/**
* Displays the links
*/
require('./libraries/server_links.inc.php');
require './libraries/server_links.inc.php';
/**
@@ -212,9 +216,9 @@ if (count($databases) > 0) {
if ( $is_superuser || $cfg['AllowUserDropDatabase'] ) {
echo ' <td class="tool">' . "\n";
if ($current['SCHEMA_NAME'] != 'mysql' && (PMA_MYSQL_INT_VERSION < 50002 || $current['SCHEMA_NAME'] != 'information_schema')) {
echo ' <input type="checkbox" name="selected_db[]" title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" value="' . htmlspecialchars($current['SCHEMA_NAME']) . '" ' . (empty($checkall) ? '' : 'checked="checked" ') . '/>' . "\n";
echo ' <input type="checkbox" name="selected_dbs[]" title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" value="' . htmlspecialchars($current['SCHEMA_NAME']) . '" ' . (empty($checkall) ? '' : 'checked="checked" ') . '/>' . "\n";
} else {
echo ' <input type="checkbox" name="selected_db[]" title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" value="' . htmlspecialchars($current['SCHEMA_NAME']) . '" disabled="disabled"/>' . "\n";
echo ' <input type="checkbox" name="selected_dbs[]" title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" value="' . htmlspecialchars($current['SCHEMA_NAME']) . '" disabled="disabled"/>' . "\n";
}
echo ' </td>' . "\n";
}
@@ -333,13 +337,13 @@ if (count($databases) > 0) {
* Create new database.
*/
echo '<ul><li id="li_create_database">' . "\n";
require('./libraries/display_create_database.lib.php');
require './libraries/display_create_database.lib.php';
echo ' </li>' . "\n";
echo '</ul>' . "\n";
/**
* Sends the footer
*/
require_once('./libraries/footer.inc.php');
require_once './libraries/footer.inc.php';
?>