From bf620ee826731dbd82df6fa14a9e5cae911ee0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 20 Nov 2003 15:04:12 +0000 Subject: [PATCH] Allow changing of default queries (RFE #839168). Documentation.html is valid XHTML again. --- ChangeLog | 4 ++ Documentation.html | 118 +++++++++++++++++--------------- Documentation.txt | 38 +++++----- config.inc.php | 8 +++ db_details.php | 9 ++- libraries/config_import.lib.php | 8 +++ tbl_query_box.php | 10 ++- 7 files changed, 116 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index a057abb69..ea43fcac5 100755 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,10 @@ $Source$ operations. * server_databases.php: Add correct parameters to left frame to keep server choice, language, etc. (bug #845397). + * libraries/config_import.lib.php, config.inc.php, db_details.php, + tbl_query_box.php, Documentation: Allow changing of default queries (RFE + #839168). + * Documentation.html: Valid XHTML again. 2003-11-20 Garvin Hicking * libraries/auth/*, libraries/dbg/*, libraries/export/* diff --git a/Documentation.html b/Documentation.html index 65e6a80ec..3da7b3da7 100755 --- a/Documentation.html +++ b/Documentation.html @@ -658,6 +658,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' foreign keys (key value and "display field" are shown)
(see FAQ 6.21) +
  • display links on the table properties page, to check referential integrity (display missing foreign keys) for each described key; @@ -1743,8 +1744,8 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

    - -
    $cfg['WYSIWYG-PDF'] boolean
    +
    + $cfg['WYSIWYG-PDF'] boolean
    Utilizes a WYSIWYG editing control to easily place elements of a PDF page. By clicking on the button 'toggle scratchboard' on the page @@ -1775,6 +1776,14 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

    +
    $cfg['DefaultQueryTable'] string
    +
    $cfg['DefaultQueryDatabase'] string
    +
    + Default query that will be displayed in query boxes, when user didn't + specify any. Use %d for database name and %t for table name. +

    +
    +
    $cfg['SQP']['fmtType'] string [html|none]
    The main use of the new SQL Parser is to pretty-print SQL queries. By @@ -1939,7 +1948,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

    Introduction  -  Usage  -  -File structure  -  +File structure


    @@ -3444,19 +3453,15 @@ To create a new, empty mimetype please see libraries/transformations/template_ge You can simply include table in your LaTeX documents, minimal sample document should look like following one (assuming you have table exported in file table.tex): -
    -
    -
    -\documentclass{article}
    -\usepackage{longtable}
    -
    -\begin{document}
    -
    -\include{table}
    -
    -\end{document}
    -

    + +
    +\documentclass{article} % or any class you want
    +\usepackage{longtable}  % for displaying table
    +\begin{document}        % start of document
    +\include{table}         % including exported table
    +\end{document}          % end of document
    +

    [6.20] In MySQL 4, I see a lot of databases which are not mine, and cannot @@ -3575,50 +3580,49 @@ To create a new, empty mimetype please see libraries/transformations/template_ge The team regrets that the author did not communicate with us before sending this alert. However, here is our current reply to the points mentionned: -

    -
      -
    • "Directory transversal attack" -

      - - This problem had been fixed in version 2.5.0, even if the author reports - the 2.5.2 development version as vulnerable, which we could not reproduce. -

      -
    • -
    • "Remote local file retrieving" -

      - This is a misleading title, as the author tells in his text: - "Note that you can't request files ( only dirs )". -

      -
    • - -
    • "Remote internal directory listing" -

      - It was possible to retrieve the list of phpMyAdmin's directory (which we - doubt can cause any damage), but we fixed this in the - 2.5.2 version. -

      -
    • - -
    • "XSS and Path disclosures" -

      - Most of the XSS problems have been fixed in version 2.5.0. The rest - have been fixed in the 2.5.2 version. -

      - We believe that the Path disclosures problems have also been fixed - in version 2.5.2. -

      -
    • -
    • "Information encoding weakness" -

      - We believe that an exploit for this weakness would be difficult - to achieve. However version 2.5.2 now encrypts the password - with the well-known blowfish algorithm. -

      -
    • -
    -

    +
      +
    • "Directory transversal attack" +

      + + This problem had been fixed in version 2.5.0, even if the author reports + the 2.5.2 development version as vulnerable, which we could not reproduce. +

      +
    • +
    • "Remote local file retrieving" +

      + This is a misleading title, as the author tells in his text: + "Note that you can't request files ( only dirs )". +

      +
    • + +
    • "Remote internal directory listing" +

      + It was possible to retrieve the list of phpMyAdmin's directory (which we + doubt can cause any damage), but we fixed this in the + 2.5.2 version. +

      +
    • + +
    • "XSS and Path disclosures" +

      + Most of the XSS problems have been fixed in version 2.5.0. The rest + have been fixed in the 2.5.2 version. +

      + We believe that the Path disclosures problems have also been fixed + in version 2.5.2. +

      +
    • +
    • "Information encoding weakness" +

      + We believe that an exploit for this weakness would be difficult + to achieve. However version 2.5.2 now encrypts the password + with the well-known blowfish algorithm. +

      +
    • +
    +

    Developers Information

    diff --git a/Documentation.txt b/Documentation.txt index 73ae4000f..3d7261b74 100644 --- a/Documentation.txt +++ b/Documentation.txt @@ -14,18 +14,15 @@ + Version history: ChangeLog + General notes: README + License: LICENSE - * Documentation version: $Id: Documentation.html,v 1.518 2003/11/07 - 18:01:55 lem9 Exp $ + * Documentation version: $Id: Documentation.html,v 2.1 2003/11/19 + 11:36:19 rabus Exp $ Requirements - * PHP3, PHP4 or PHP5: phpMyAdmin widely uses the 'str_replace()' PHP - function that was added in PHP 3.0.6, but was buggy up until - PHP 3.0.8. Then you should not run this script with PHP3 < 3.0.8. - PHP also needs to be compiled with MySQL support; + * php 4.1.0 or later If you want to display inline thumbnails of JPEGs with the original aspect ratio, you also need GD2 support in PHP. - * MySQL 3.21 or newer (details); + * MySQL 3.23.32 or newer (details); * a web-browser (doh!). Introduction @@ -1201,6 +1198,12 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' functionality was kindly borrowed from www.youngpup.net and is underlying so specific license. + $cfg['DefaultQueryTable'] string + $cfg['DefaultQueryDatabase'] string + Default query that will be displayed in query boxes, when user + didn't specify any. Use %d for database name and %t for table + name. + $cfg['SQP']['fmtType'] string [html|none] The main use of the new SQL Parser is to pretty-print SQL queries. By default we use HTML to format the query, but you @@ -1318,7 +1321,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' Transformations - Introduction - Usage - File structure - + Introduction - Usage - File structure [1. Introduction] @@ -1659,9 +1662,9 @@ FAQ - Frequently Asked Questions [1.17] Which MySQL versions does phpMyAdmin support? - All MySQL versions from 3.21 till 4.0 are fully supported. Please note - that the older your MySQL version is, the more limitations you will - have to face. + All MySQL versions from 3.23.32 till 4.0 are fully supported. Please + note that the older your MySQL version is, the more limitations you + will have to face. phpMyAdmin provides experimental support for MySQL 4.1. That means that although you can assign character sets to a table or field, phpMyAdmin will not recode the data when inserting or extracting it. @@ -2421,14 +2424,11 @@ FAQ - Frequently Asked Questions You can simply include table in your LaTeX documents, minimal sample document should look like following one (assuming you have table exported in file table.tex): -\documentclass{article} -\usepackage{longtable} - -\begin{document} - -\include{table} - -\end{document} +\documentclass{article} % or any class you want +\usepackage{longtable} % for displaying table +\begin{document} % start of document +\include{table} % including exported table +\end{document} % end of document [6.20] In MySQL 4, I see a lot of databases which are not mine, and cannot access them. diff --git a/config.inc.php b/config.inc.php index b179d18fc..4ffcb63a0 100644 --- a/config.inc.php +++ b/config.inc.php @@ -502,6 +502,14 @@ $cfg['MaxExactCount'] = 20000; // When approximate count < this, PM $cfg['WYSIWYG-PDF'] = TRUE; // Utilize DHTML/JS capabilities to allow WYSIWYG editing of // the PDF page editor. Requires an IE6/Mozilla based browser. +/** + * Default queries. + * %d will be replaced by database name + * %t will be replaced by table name + */ +$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; +$cfg['DefaultQueryDatabase']= ''; + /** * SQL Query box settings * These are the links display in all of the SQL Query boxes diff --git a/db_details.php b/db_details.php index 825aed013..884f30653 100644 --- a/db_details.php +++ b/db_details.php @@ -62,8 +62,13 @@ $auto_sel = ($cfg['TextareaAutoSelect']  :

    +
     
    diff --git a/libraries/config_import.lib.php b/libraries/config_import.lib.php index 157dd7f0f..753bf3c70 100644 --- a/libraries/config_import.lib.php +++ b/libraries/config_import.lib.php @@ -788,6 +788,14 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) { if (!isset($cfg['WYSIWYG-PDF'])) { $cfg['WYSIWYG-PDF'] = TRUE; } + + if (!isset($cfg['DefaultQueryTable'])) { + $cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; + } + + if (!isset($cfg['DefaultQueryDatabase'])) { + $cfg['DefaultQueryDatabase']= ''; + } if (!isset($cfg['ShowTooltipAliasDB'])) { $cfg['ShowTooltipAliasDB'] = FALSE; diff --git a/tbl_query_box.php b/tbl_query_box.php index a3d3586b4..2d2af5201 100644 --- a/tbl_query_box.php +++ b/tbl_query_box.php @@ -142,7 +142,15 @@ if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) { ' : ' ') . PMA_showMySQLDocu('Reference', 'SELECT'); ?>
    + 0) { ?> ' : '') . $strFields; ?>: