From 2d2b95a0829ad4ab765d775eb4a6c1df9983fca9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 17:01:57 +0100 Subject: [PATCH] Fix calculation of top menu entry of user --- htdocs/theme/eldy/style.css.php | 7 ++++++- htdocs/theme/md/style.css.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 746ea68969d..ea24aaf20b0 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -65,7 +65,12 @@ require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) -if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login'],'',1); +// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile. +if (empty($user->id) && ! empty($_SESSION['dol_login'])) +{ + $user->fetch('',$_SESSION['dol_login'],'',1); + $user->getrights(); +} // Define css type diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 4a81142900b..30c781c2bfe 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -66,7 +66,12 @@ require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) -if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login'],'',1); +// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile. +if (empty($user->id) && ! empty($_SESSION['dol_login'])) +{ + $user->fetch('',$_SESSION['dol_login'],'',1); + $user->getrights(); +} // Define css type