From 9172958f7caefcfd161f6a7051c308b055a26fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20M=C3=BCller?= Date: Fri, 21 Jun 2002 21:38:15 +0000 Subject: [PATCH] =?UTF-8?q?2002-06-21=20Olivier=20L.=20M=EF=BF=BDller=20?= =?UTF-8?q?=20=20=20=20=20=20*=20libraries/common.lib.php3,?= =?UTF-8?q?=20main.php3:=20be=20more=20tolerant=20with=20lazy=20=20=20=20?= =?UTF-8?q?=20=20=20sysadmins=20or=20users=20by=20letting=20them=20having?= =?UTF-8?q?=20an=20empty=20=20=20=20=20=20=20$cfg['PmaAbsoluteUri'].=20A?= =?UTF-8?q?=20default=20value=20(which=20should=20work=20according=20=20?= =?UTF-8?q?=20=20=20=20=20to=20the=20docs...)=20will=20be=20set=20and=20a?= =?UTF-8?q?=20warning=20displayed=20on=20main.php3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 6 ++++++ libraries/common.lib.php3 | 26 ++++++++++++++++++++------ main.php3 | 6 ++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a23cc177..430137d46 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-06-21 Olivier L. Müller + * libraries/common.lib.php3, main.php3: be more tolerant with lazy + sysadmins or users by letting them having an empty + $cfg['PmaAbsoluteUri']. A default value (which should work according + to the docs...) will be set and a warning displayed on main.php3. + 2002-06-21 Robin Johnson * lang/english*: $strSplitWordsWithSpace - 'splitted' changed to 'seperated' diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 57c5f674a..1126be71e 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -489,13 +489,27 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} * set properly and, depending on browsers, inserting or updating a * record might fail */ + + $DisplayPmaAbsoluteUriWarning = 0; + if (empty($cfg['PmaAbsoluteUri'])) { - if (empty($GLOBALS['is_header_sent'])) { - include('./header.inc.php3'); - } - echo '

'. $strPmaUriError . '

' . "\n"; - include('./footer.inc.php3'); - exit(); + // if (empty($GLOBALS['is_header_sent'])) { + // include('./header.inc.php3'); + // } + // echo '

'. $strPmaUriError . '

' . "\n"; + // include('./footer.inc.php3'); + // exit(); + + $DisplayPmaAbsoluteUriWarning = 1; + + // Setup a default value to let the people and lazy syadmins work anyway, + // but display a big warning on the main.php3 page. --Olivier + + $cfg['PmaAbsoluteUri'] = (!empty($HTTP_SERVER_VARS['HTTPS']) ? 'https' : 'http') . '://' + . $HTTP_SERVER_VARS['SERVER_NAME'] + . (!empty($HTTP_SERVER_VARS['SERVER_PORT']) ? ':' . $HTTP_SERVER_VARS['SERVER_PORT'] : '') + . substr($HTTP_SERVER_VARS['SCRIPT_NAME'], 0, strrpos($HTTP_SERVER_VARS['SCRIPT_NAME'], '/')+1); + } // Adds a trailing slash et the end of the phpMyAdmin uri if it does not // exist diff --git a/main.php3 b/main.php3 index 851d3e5eb..d50e13c98 100755 --- a/main.php3 +++ b/main.php3 @@ -562,6 +562,12 @@ echo "\n"; '. $strPmaUriError . '

' . "\n"; +} + /** * Displays the footer */