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 */