From f370db594265974754d98e6984d012d0f3c1f38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 23 Nov 2005 20:30:56 +0000 Subject: [PATCH] Add target parameter to index.php to allow direct jump to any script. --- ChangeLog | 2 ++ Documentation.html | 11 +++++++---- index.php | 4 ++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10b39a93e..d788dcbbf 100755 --- a/ChangeLog +++ b/ChangeLog @@ -67,6 +67,8 @@ $Source$ * Documentation.html: Recommend disabling access to libraries folder. * libraries/display_export.lib.php, lang/*: Better description for filename format (RFE #1362423). + * Documentation.html, index.php: Add target parameter to index.php to + allow direct jump to any script. 2005-11-22 Sebastian Mendel * added test/theme.php: for testing themes diff --git a/Documentation.html b/Documentation.html index 5f0af5d7e..2b43592d3 100755 --- a/Documentation.html +++ b/Documentation.html @@ -2730,10 +2730,11 @@ To create a new, empty mimetype please see libraries/transformations/template_ge

Yes. Out of the box, you can use URLs like - http://server/phpMyAdmin/index.php?db=database&table=table. If you - want http://server/phpMyAdmin/database/table URLs, you need to do some - configuration. Following lines apply only for Apache web server. First make sure, + http://server/phpMyAdmin/index.php?db=database&table=table&target=script. + Table and script parts are optional. If you want + http://server/phpMyAdmin/database[/table][/script] URLs, you need to do + some configuration. Following lines apply only for Apache web server. First make sure, that you have enabled some features within global configuration. You need Options FollowSymLinks and AllowOverride FileInfo enabled for directory where phpMyAdmin is installed and @@ -2745,6 +2746,8 @@ To create a new, empty mimetype please see libraries/transformations/template_ge

 RewriteEngine On
 RewriteBase /path_to_phpMyAdmin
+RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R]
+RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R]
 RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
 RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
 
diff --git a/index.php b/index.php index 8056ed567..c55367bc0 100644 --- a/index.php +++ b/index.php @@ -112,6 +112,10 @@ if ( empty( $GLOBALS['db'] ) ) { $main_target = $GLOBALS['cfg']['DefaultTabTable']; } +if (!empty($GLOBALS['target']) && preg_match('@[a-z_]+\.php@', $GLOBALS['target']) && $GLOBALS['target'] != 'index.php') { + $main_target = $GLOBALS['target']; +} + $main_target .= '?' . $url_query; $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][2];