From cbd8c25123a1147b58ecf1a174e1f6424fef220b Mon Sep 17 00:00:00 2001 From: jervfors Date: Tue, 31 Jan 2006 15:03:06 +0000 Subject: [PATCH] Work around the fact that /src/style.php depends on a logged in user, thus breaking the login page. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10619 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/page_header.php | 37 ++++++++++++++++++++++--------------- src/login.php | 4 ++-- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/functions/page_header.php b/functions/page_header.php index ab3ece74..e718772b 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -31,9 +31,10 @@ include_once(SM_PATH . 'class/template/template.class.php'); * @param string xtra extra HTML to insert into the header * @param bool do_hook whether to execute hooks, default true * @param bool frames generate html frameset doctype (since 1.5.1) + * @param bool style use style.php CSS, default true (since 1.5.1) * @return void */ -function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = true, $frames = false ) { +function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE, $frames = FALSE, $style = TRUE ) { global $squirrelmail_language, $sTplDir; if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { @@ -58,13 +59,19 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = true $used_theme = basename($chosen_theme,'.php'); /* - * Add closing / to link and meta elements only after switching to xhtml 1.0 Transitional. - * It is not compatible with html 4.01 Transitional - */ - echo '\n"; + * The $style parameter is needed since style.php breaks the login otherwise. + * This can be removed when style.php doesn't depend on a logged in user. + */ + if ($style) { + /* + * Add closing / to link and meta elements only after switching to xhtml 1.0 Transitional. + * It is not compatible with html 4.01 Transitional + */ + echo '\n"; + } // load custom style sheet (deprecated) if ( !isset( $theme_css ) || empty($theme_css) ) { @@ -73,12 +80,12 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = true if ($squirrelmail_language == 'ja_JP') { /* - * force correct detection of charset, when browser does not follow - * http content-type and tries to detect charset from page content. - * Shooting of browser's creator can't be implemented in php. - * We might get rid of it, if we follow http://www.w3.org/TR/japanese-xml/ - * recommendations and switch to unicode. - */ + * force correct detection of charset, when browser does not follow + * http content-type and tries to detect charset from page content. + * Shooting of browser's creator can't be implemented in php. + * We might get rid of it, if we follow http://www.w3.org/TR/japanese-xml/ + * recommendations and switch to unicode. + */ echo "\n"; echo '' . "\n"; } @@ -275,4 +282,4 @@ function compose_Header($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') { } echo "\n\n"; } -?> +?> \ No newline at end of file diff --git a/src/login.php b/src/login.php index 7a5d0cbb..ad93468f 100644 --- a/src/login.php +++ b/src/login.php @@ -117,7 +117,7 @@ if (! isset($color) || ! is_array($color)) { $color[8] = '#000000'; /* black Normal text */ } -displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE ); +displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE, FALSE, FALSE ); echo "" . "\n" . '
' . "\n"; @@ -203,4 +203,4 @@ echo '
' . "\n"; do_hook('login_bottom'); ?> - + \ No newline at end of file -- 2.25.1