From adf0c75d55c618bac8018ca1a52239d858c72a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 23 Nov 2005 21:30:53 +0000 Subject: [PATCH] Allow browse page to be default (RFE #1228013). --- ChangeLog | 2 ++ Documentation.html | 4 ++-- config.default.php | 5 +++-- sql.php | 9 +++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfb9e95fe..ec0e19404 100755 --- a/ChangeLog +++ b/ChangeLog @@ -74,6 +74,8 @@ $Source$ * footer.inc.php, server_links.inc.php, css/phpmyadmin.css.php, lang/*, libraries/common.lib.php: Add link for duplicating current frameset (RFE #1165206). + * config.default.php, sql.php, Documentation.html: Allow browse page to be + default (RFE #1228013). 2005-11-22 Sebastian Mendel * added test/theme.php: for testing themes diff --git a/Documentation.html b/Documentation.html index 2b43592d3..5f12f7818 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1286,8 +1286,8 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
Defines the tab displayed by default on table view. Possible values: "tbl_properties_structure.php", - "tbl_properties.php", "tbl_select.php" or - "tbl_change.php". + "tbl_properties.php", "tbl_select.php", + "tbl_change.php" or "sql.php".
$cfg['MySQLManualBase'] string
diff --git a/config.default.php b/config.default.php index 38a85ee06..f4f83e016 100644 --- a/config.default.php +++ b/config.default.php @@ -233,8 +233,9 @@ $cfg['DefaultTabTable'] = 'tbl_properties_structure.php'; // Possible values: // 'tbl_properties_structure.php' = fields list // 'tbl_properties.php' = sql form - // 'tbl_select.php = select page - // 'tbl_change.php = insert row page + // 'tbl_select.php' = select page + // 'tbl_change.php' = insert row page + // 'sql.php' = browse page /** * Export defaults diff --git a/sql.php b/sql.php index 93c6b17ce..c2bcfbf0f 100644 --- a/sql.php +++ b/sql.php @@ -43,8 +43,13 @@ if (isset($fields['dbase'])) { $db = $fields['dbase']; } -// Now we can check the parameters -PMA_checkParameters(array('sql_query')); +// Default to browse if no query set an we have table (needed for browsing from DefaultTabTable) +if (!isset($sql_query) && isset($table) && isset($db)) { + $sql_query = 'SELECT * FROM ' . PMA_backquote($table); +} else { + // Now we can check the parameters + PMA_checkParameters(array('sql_query')); +} // instead of doing the test twice $is_drop_database = preg_match('@DROP[[:space:]]+DATABASE[[:space:]]+@i', $sql_query);