From c94c1b7f8597f8930cad7547c06665e93bce9e02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Feb 2012 17:10:29 +0100 Subject: [PATCH] Fix: The login page must use same header than others. --- htdocs/core/lib/security2.lib.php | 16 +++++++---- htdocs/core/tpl/login.tpl.php | 45 ++++++++++++++++--------------- htdocs/main.inc.php | 14 +++++----- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index c6d7863e83d..4fa799bb8c3 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -149,12 +149,13 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod /** - * Show Dolibarr default login page + * Show Dolibarr default login page. + * Part of this code is also duplicated into main.inc.php::top_htmlhead * - * @param Translate $langs Lang object (must be initialized by a new). - * @param Conf $conf Conf object - * @param Societe $mysoc Company object - * @return void + * @param Translate $langs Lang object (must be initialized by a new). + * @param Conf $conf Conf object + * @param Societe $mysoc Company object + * @return void */ function dol_loginfunction($langs,$conf,$mysoc) { @@ -327,9 +328,14 @@ function dol_loginfunction($langs,$conf,$mysoc) $main_google_ad_client = ((! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))?1:0); $dol_loginmesg = $_SESSION["dol_loginmesg"]; + $favicon=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/favicon.ico'; + $jquerytheme = 'smoothness'; + if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; + include($template_dir.'login.tpl.php'); // To use native PHP + $_SESSION["dol_loginmesg"] = ''; } diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 4e6fd48d7cd..98565ca757e 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -19,40 +19,44 @@ header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); + ?> - - - - - - + - + + -<?php echo $langs->trans('Login'); ?> - - - + + +'.$langs->trans('Login').' '.$title.''."\n"; +print ''."\n"; +if (constant('JS_JQUERY')) print ''."\n"; // JQuery +else print ''."\n"; // JQuery +// JQuery. Must be before other includes +print ''."\n"; +if (constant('JS_JQUERY')) print ''."\n"; +else print ''."\n"; +print ' -global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; ?> - - +'; +if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; +print ' +'; + +?> @@ -336,5 +340,4 @@ jQuery(document).ready(function () { - - \ No newline at end of file + diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c6e8614e9c2..25d7aa22753 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -793,7 +793,8 @@ function top_httphead() } /** - * Replace the default llxHeader function + * Ouput html header of a page. + * This code is also duplicated into security2.lib.php::dol_loginfunction * * @param string $head Optionnal head lines * @param string $title HTML title @@ -813,9 +814,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''; //print ''; - //print ''; - //print ''; - //print ''; + //print ''; + //print ''; + //print ''; print "\n"; if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print ''."\n"; else print ''."\n"; @@ -824,8 +825,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print "\n"; - print "\n"; - // Displays meta print ''."\n"; // Evite indexation par robots print ''."\n"; @@ -844,7 +843,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; $jquerytheme = 'smoothness'; if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; - print ''."\n"; // JQuery + if (constant('JS_JQUERY')) print ''."\n"; // JQuery + else print ''."\n"; // JQuery print ''."\n"; // Tooltip print ''."\n"; // JNotify //print ''."\n"; // Lightbox