From c28a9175ecda9027eac4199ca7e4ea8f3567c679 Mon Sep 17 00:00:00 2001 From: Robin Johnson Date: Sat, 3 Aug 2002 21:34:20 +0000 Subject: [PATCH] * db_details.php3, db_stats.php3, main.php3, sql.php3 tbl_change.php3, tbl_query_box.php3, user_details.php3 libraries/common.lib.php3: - changed show_query to use 1/0 instead of 'y'/'n' * sql.php3, libraries/common.lib.php3: - Improved logic of edit, show_as_php, explain and validator in the SQL query box --- ChangeLog | 42 ++++++---- db_details.php3 | 4 +- db_stats.php3 | 2 +- libraries/common.lib.php3 | 170 +++++++++++++++++++------------------- main.php3 | 2 +- sql.php3 | 2 +- tbl_change.php3 | 6 +- tbl_query_box.php3 | 4 +- user_details.php3 | 10 +-- 9 files changed, 126 insertions(+), 116 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20990ff1f..744a19c70 100755 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,13 @@ $Source$ * ChangeLog: - Neatened Changelog to general follow a format - (* :
) + * db_details.php3, db_stats.php3, main.php3, sql.php3 + tbl_change.php3, tbl_query_box.php3, user_details.php3 + libraries/common.lib.php3: + - changed show_query to use 1/0 instead of 'y'/'n' + * sql.php3, libraries/common.lib.php3: + - Improved logic of edit, show_as_php, explain and validator + in the SQL query box 2002-08-02 Robin Johnson * libraries/defines*: @@ -107,7 +114,7 @@ $Source$ * lang/italian: update, thanks to Pietro Danesi * lang/lithuanian: update, thanks to Vilius Zigmantas * lang/dutch: update, thanks to Ivo Teel. - * :2.3.0-rc4 released + 2.3.0-rc4 released 2002-07-27 Marc Delisle * lang/italian: update, thanks to Pietro Danesi @@ -126,8 +133,8 @@ $Source$ 2002-07-25 Loïc Chapeaux * libraries/sqlparser.lib.php3: - - PHP3 parse errors fixed; - - coding standards. + - PHP3 parse errors fixed; + - coding standards. * pdf_schema.php3; lang/*: translated a string. * header.inc.php3, lines 155-156: better "fix" against bug #585094 (Runtime Error on Line 62). @@ -258,8 +265,8 @@ $Source$ * lang/sync_lang.sh: support for multiple convertors (recode added), thanks to Michal Cihar * lang/spanish update: - - thanks to Daniel Hinostroza - - (Daniel.Hinostroza at grunenthal.com.ec) + - thanks to Daniel Hinostroza + - (Daniel.Hinostroza at grunenthal.com.ec) * lang/swedish: updates: thanks to Björn T. Hallberg * lang/indonesian: updates, thanks to Rachim Tamsjadi. * lang/japanese*: updates, thanks to Yukihiro Kawada @@ -300,8 +307,8 @@ $Source$ 2002-07-15 Alexander M. Turek * libraries/config_import.lib.php3: - - Removed a comment and - - Changed the default value for $cfg['AllowAnywhereRecoding'] into FALSE. + - Removed a comment and + - Changed the default value for $cfg['AllowAnywhereRecoding'] into FALSE. * header.inc.php3: Better fix against bug #571409, thanks to Loïc. * libraries/common.lib.php3: Coding standards. @@ -321,7 +328,7 @@ $Source$ * Documentation.html, db_details_exports.php3, tbl_properties_export.php3: add a link to a new faq entry explaining some dump options * libraries/relation.lib.php3: bug 575868 Unitialized string offset - * 2.3.0-rc3 released + 2.3.0-rc3 released 2002-07-14 Alexander M. Turek * config.inc.php3, libraries/common.lib.php3: Fixed bug #576018. @@ -451,7 +458,7 @@ $Source$ 2002-06-30 Marc Delisle * user_details.php3: fix the tooltip - * 2.3.0-rc2 released + 2.3.0-rc2 released 2002-06-30 Alexander M. Turek * user_details.php3: Added a tooltip for the new documenation link. @@ -529,13 +536,14 @@ $Source$ * lang/portuguese.inc.php3 updates: thanks to Lopo Pizarro 2002-06-23 Alexander M. Turek - * Revised some files in /lang/: - - chinese_*.inc.php3, estonian.inc.php3, finnish.inc.php3: - Reordered Strings. - - arabic.inc.php3, brazilian_portuguese.inc.php3, bulgarian_*.php3, - croatian-*.php3, danish.inc.php3, korean.inc.php3, russian_*.inc.php3, - serbian-win1250.inc.php3: Synchronized the untranslated string - $strSplitWordsWithSpace with the English translation. + Revised some files in /lang/: + * chinese_*.inc.php3, estonian.inc.php3, finnish.inc.php3: + - Reordered Strings. + * arabic.inc.php3, brazilian_portuguese.inc.php3, bulgarian_*.php3, + croatian-*.php3, danish.inc.php3, korean.inc.php3, russian_*.inc.php3, + serbian-win1250.inc.php3: + - Synchronized the untranslated string + $strSplitWordsWithSpace with the English translation. 2002-06-23 Olivier L. Müller * db_stats.php3: Fixed warning from mysql_free_result. @@ -1344,7 +1352,7 @@ $Source$ authentication mode with IIS. 2002-04-21 Marc Delisle - * ### 2.2.6 released ### + ### 2.2.6 released ### --- Older ChangeLogs can be found on our project website --- diff --git a/db_details.php3 b/db_details.php3 index 2bfcb96fa..7d220d1ff 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -11,7 +11,7 @@ $url_query .= '&goto=db_details.php3'; /** * Database work */ -if (isset($show_query) && $show_query == 'y') { +if (isset($show_query) && $show_query == '1') { // This script has been called by read_dump.php3 if (isset($sql_query_cpy)) { $query_to_display = $sql_query_cpy; @@ -65,7 +65,7 @@ $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get')) onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; this.form.elements['sql_query'].select();}">
-   +  
' . $GLOBALS['strEdit'] . '' + . '' . $GLOBALS['strEdit'] . '' . ']' . "\n"; } // end if echo '

' . "\n" @@ -1113,12 +1113,15 @@ if (typeof(document.getElementById) != 'undefined' // The nl2br function isn't used because its result isn't a valid // xhtml1.0 statement before php4.0.5 ("
" and not "
") // If we want to show some sql code it is easiest to create it here + /* SQL-Parser-Analyzer */ $sqlnr = 1; if (!empty($GLOBALS['show_as_php'])) { $new_line = '";
' . "\n" . ' $sql .= "'; } if (isset($new_line)) { + /* SQL-Parser-Analyzer */ $query_base = htmlspecialchars($GLOBALS['sql_query']); + /* SQL-Parser-Analyzer */ $query_base = ereg_replace("((\015\012)|(\015)|(\012))+", $new_line, $query_base); } else { $query_base = $GLOBALS['sql_query']; @@ -1133,99 +1136,98 @@ if (typeof(document.getElementById) != 'undefined' } // Prepares links that may be displayed to edit/explain the query - if (!isset($GLOBALS['show_query']) || $GLOBALS['show_query'] != 'y') { - if (!isset($GLOBALS['goto'])) { - $edit_target = (isset($GLOBALS['table'])) ? 'tbl_properties.php3' : 'db_details.php3'; - } else if ($GLOBALS['goto'] != 'main.php3') { - $edit_target = $GLOBALS['goto']; - } else { - $edit_target = ''; - } - - if (isset($cfg['SQLQuery']['Edit']) - && $cfg['SQLQuery']['Edit'] == TRUE) { - if ($edit_target == 'tbl_properties.php3') { - $edit_link = '' . $GLOBALS['strEdit'] . ''; - } else if ($edit_target != '') { - $edit_link = '' . $GLOBALS['strEdit'] . ''; - } - $edit_link = ' [' . $edit_link . ']'; - } else { - $edit_link = ''; - } - - // Want to have the query explained (Mike Beck 2002-05-22) - // but only explain a SELECT (that has not been explained) - /* SQL-Parser-Analyzer */ - if (isset($cfg['SQLQuery']['Explain']) - && $cfg['SQLQuery']['Explain'] == TRUE) { - // Detect if we are validating as well - // To preserve the validate uRL data - if (!empty($GLOBALS['validatequery'])) { - $explain_link_validate = '&validatequery=1'; - } else { - $explain_link_validate = ''; - } + if (!isset($GLOBALS['goto'])) { + $edit_target = (isset($GLOBALS['table'])) ? 'tbl_properties.php3' : 'db_details.php3'; + } else if ($GLOBALS['goto'] != 'main.php3') { + $edit_target = $GLOBALS['goto']; + } else { + $edit_target = ''; + } + + if (isset($cfg['SQLQuery']['Edit']) + && ($cfg['SQLQuery']['Edit'] == TRUE ) + && (!empty($edit_target))) { + + $edit_link = ' [' . $GLOBALS['strEdit'] . ']'; + } else { + $edit_link = ''; + } + + // Want to have the query explained (Mike Beck 2002-05-22) + // but only explain a SELECT (that has not been explained) + /* SQL-Parser-Analyzer */ + if (isset($cfg['SQLQuery']['Explain']) + && $cfg['SQLQuery']['Explain'] == TRUE) { + + // Detect if we are validating as well + // To preserve the validate uRL data + if (!empty($GLOBALS['validatequery'])) { + $explain_link_validate = '&validatequery=1'; + } else { + $explain_link_validate = ''; + } - $explain_link = ' [' . $GLOBALS['strExplain']; - } else if (eregi('^EXPLAIN[[:space:]]+SELECT[[:space:]]+', $GLOBALS['sql_query'])) { - $explain_link .= substr($GLOBALS['sql_query'],8) . '">' . $GLOBALS['strNoExplain']; - } else { - $explain_link = ''; - } - if(!empty($explain_link)) { - $explain_link .= ']'; - } + if (eregi('^SELECT[[:space:]]+', $GLOBALS['sql_query'])) { + $explain_link .= urlencode('EXPLAIN ' . $GLOBALS['sql_query']) . '">' . $GLOBALS['strExplain']; + } else if (eregi('^EXPLAIN[[:space:]]+SELECT[[:space:]]+', $GLOBALS['sql_query'])) { + $explain_link .= substr($GLOBALS['sql_query'],8) . '">' . $GLOBALS['strNoExplain']; } else { $explain_link = ''; } + if(!empty($explain_link)) { + $explain_link .= ']'; + } + } else { + $explain_link = ''; + } //show explain - // Also we would like to get the SQL formed in some nice - // php-code (Mike Beck 2002-05-22) - if (isset($cfg['SQLQuery']['ShowAsPHP']) - && $cfg['SQLQuery']['ShowAsPHP'] == TRUE) { - if (!empty($GLOBALS['show_as_php'])) { - $php_link = '' . $GLOBALS['strNoPhp'] . ''; - } else { - $php_link = '' . $GLOBALS['strPhp'] . ''; - } - $php_link = ' [' . $php_link . ']'; - } else { - $php_link = ''; - } + // Also we would like to get the SQL formed in some nice + // php-code (Mike Beck 2002-05-22) + if (isset($cfg['SQLQuery']['ShowAsPHP']) + && $cfg['SQLQuery']['ShowAsPHP'] == TRUE) { + $php_link = ' [
-   +  
'; } if (isset($message)) { - $show_query = 'y'; + $show_query = '1'; PMA_showMessage($message); } @@ -1104,7 +1104,7 @@ else if (isset($delete) && $delete // Adds an user else if (isset($submit_addUser)) { - $show_query = 'y'; + $show_query = '1'; if (!isset($host) || $host == '') { $host = '%'; } @@ -1159,7 +1159,7 @@ else if (isset($submit_addUser)) { // Updates the profile of an user else if (isset($submit_updProfile)) { - $show_query = 'y'; + $show_query = '1'; $edit = TRUE; if (!isset($host) || $host == '') { $host = '%'; @@ -1262,7 +1262,7 @@ else if (isset($submit_updProfile)) { // Changes the privileges of an user else if (isset($submit_chgPriv)) { - $show_query = 'y'; + $show_query = '1'; $edit = TRUE; if (!isset($host) || $host == '') { $host = '%'; @@ -1293,7 +1293,7 @@ else if (isset($submit_chgPriv)) { // Revoke/Grant privileges else if (isset($grants) && $grants) { - $show_query = 'y'; + $show_query = '1'; if (!isset($host) || $host == '') { $host = '%'; }