From a34de44b79e6dc1546924eac7278368afb836d55 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Fri, 16 Oct 2009 17:24:18 +0000
Subject: [PATCH] Add hidden options MAIN_HTML_HEADER and MAIN_HTML_FOOTER

---
 htdocs/lib/security.lib.php | 7 +++++--
 htdocs/main.inc.php         | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index 057773394a1..74acd1ca144 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -96,6 +96,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
 	else print "document.getElementById('password').focus();\n";
 	print "}\n";
 	print '</script>'."\n";
+	if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";
 	print '<!-- HTTP_USER_AGENT = '.$_SERVER["HTTP_USER_AGENT"].' -->'."\n";
 	print '</head>'."\n";
 
@@ -232,7 +233,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
 		print '</td>';
 		print '</tr>'."\n";
 	}
-	
+
 	print '<tr><td colspan="3">&nbsp;</td></tr>'."\n";
 
 	print '<tr><td colspan="3" style="text-align:center;"><br>';
@@ -261,7 +262,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
 		print ')</a>';
 		print '</td></tr>';
 	}
-	
+
 	print '</table>'."\n";
 
 	// Hidden fields
@@ -313,6 +314,8 @@ function dol_loginfunction($langs,$conf,$mysoc)
 	print '<!-- cookie name used for this session = '.session_name().' -->'."\n";
 	print '<!-- urlfrom in this session = '.(isset($_SESSION["urlfrom"])?$_SESSION["urlfrom"]:'').' -->'."\n";
 
+	if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
+
 	// Fin entete html
 	print "\n</body>\n</html>";
 }
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 8c0aa8b5168..93999db7bf7 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -816,7 +816,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
 		print '""];';
 		print '</script>'."\n";
 
-		if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."<br>\n";
+		if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";
 
 		print "</head>\n\n";
 	}
@@ -1212,7 +1212,7 @@ function llxFooter($foot='')
 	print "\n";
 	if ($foot) print '<!-- '.$foot.' -->'."\n";
 
-	if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."<br>\n";
+	if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
 
 	print "</body>\n";
 	print "</html>\n";
-- 
GitLab