From c94b297c49f891fb9ca9117b33796aacaca2b32d Mon Sep 17 00:00:00 2001 From: graf25 Date: Sat, 6 Apr 2002 21:10:59 +0000 Subject: [PATCH] Three is a charm. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2692 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/display_messages.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/functions/display_messages.php b/functions/display_messages.php index 29e1c16e..024a40f8 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -12,8 +12,19 @@ * $Id$ */ +/** + * Find out where squirrelmail lives and try to be smart about it. + * The only problem would be when squirrelmail lives in directories + * called "src", "functions", or "plugins", but people who do that need + * to be beaten with a steel pipe anyway. + * + * @return the base uri of squirrelmail installation. + */ function sqm_baseuri(){ global $base_uri, $PHP_SELF; + /** + * If it is in the session, just return it. + */ if (isset($base_uri)){ return $base_uri; } @@ -115,12 +126,12 @@ function plain_error_message($message, $color) { function logout_error( $errString, $errTitle = '' ) { GLOBAL $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, - $hide_sm_attributions, $version; + $hide_sm_attributions, $version, $DOCUMENT_ROOT; $base_uri = sqm_baseuri(); - include_once($base_uri . 'functions/page_header.php' ); + include_once($DOCUMENT_ROOT . $base_uri . 'functions/page_header.php' ); if ( !isset( $org_logo ) ) { // Don't know yet why, but in some accesses $org_logo is not set. - include( $base_uri . '../config/config.php' ); + include( $DOCUMENT_ROOT . $base_uri . 'config/config.php' ); } /* Display width and height like good little people */ $width_and_height = ''; @@ -174,7 +185,8 @@ function logout_error( $errString, $errTitle = '' ) { '
' . $errString . '
'. "". "
". - '' . + '' . _("Go to the login page") . "
". ''. ''; -- 2.25.1