From c552d9d2c0084b6a879e47a0b4671091143dc678 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sat, 13 Oct 2018 07:18:33 +0000 Subject: [PATCH] Add favicon and ability for admins to use their own by setting $head_tag_extra in config_local.php (see documentation in config/config_local.php) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14789 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/config_local.example.php | 10 ++++++++++ doc/ChangeLog | 3 +++ functions/page_header.php | 16 ++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/config/config_local.example.php b/config/config_local.example.php index 0ac3d1b5..38c0f26d 100644 --- a/config/config_local.example.php +++ b/config/config_local.example.php @@ -136,4 +136,14 @@ * sm_validate_security_token() (only relevant when * $use_expiring_security_tokens is enabled). * + * $head_tag_extra can be used to add custom tags inside + * the section of *ALL* pages. The string + * "###SM BASEURI###" will be replaced with the base URI + * for this SquirrelMail installation. This may be used, + * for example, to add custom favicon tags. If this + * setting is empty here, SquirrelMail will add a favicon + * tag by default. If you want to retain the default favicon + * while using this setting, you must include the following + * as part of this setting: + * $head_tag_extra = '......'; */ diff --git a/doc/ChangeLog b/doc/ChangeLog index 58de4e7e..8830f536 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -420,6 +420,9 @@ Version 1.5.2 - SVN - Sanitize user-supplied attachment filenames (thanks to Florian Grunow for reporting this issue) [CVE-2018-8741] - Changed anti-CSRF security token lifetime to be session-based. + - Added favicon and ability for admins to use their own by setting + $head_tag_extra in config_local.php (see documentation in + config/config_local.php) Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/page_header.php b/functions/page_header.php index add7eb85..ae04d929 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -37,7 +37,8 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE } global $custom_css, $pageheader_sent, $theme, $theme_default, $text_direction, $default_fontset, $chosen_fontset, $default_fontsize, $chosen_fontsize, - $chosen_theme, $chosen_theme_path, $user_themes, $user_theme_default; + $chosen_theme, $chosen_theme_path, $user_themes, $user_theme_default, + $head_tag_extra; // add no cache headers here // @@ -79,7 +80,18 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE $oTemplate->assign('frames', $frames); $oTemplate->assign('lang', $squirrelmail_language); - $header_tags .= "\n"; + $header_tags .= "\n" + + // For adding a favicon or anything else that should be inserted in *ALL* for *ALL* documents, + // define $head_tag_extra in config/config_local.php + // The string "###SM BASEURI###" will be replaced with the base URI for this SquirrelMail installation. + // When not defined, a default is provided that displays the default favicon.ico. + // If you override this and still want to use the default favicon.ico, you'll have to include the following + // following in your $head_tag_extra string: + // $head_tag_extra = '......'; + // + . (empty($head_tag_extra) ? '' + : str_replace('###SM BASEURI###', sqm_baseuri(), $head_tag_extra)); $used_fontset = (!empty($chosen_fontset) ? $chosen_fontset : $default_fontset); $used_fontsize = (!empty($chosen_fontsize) ? $chosen_fontsize : $default_fontsize); -- 2.25.1