From a1aa7f8eb6c90bce7ac8126dcae21bfa16fa4f41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Mar 2026 20:07:24 +0100 Subject: [PATCH] Fix debug v23 --- htdocs/core/customreports.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index ed51beba822..ea36fb74428 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -237,7 +237,7 @@ if ($objecttype) { '@phan-var-force CommonObject $object'; // Security check -$socid = 0; +//$socid = 0; if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden('Access forbidden to external users'); @@ -360,6 +360,7 @@ $arrayofgroupby = array(); $arrayofyaxis = array(); $arrayofvaluesforgroupby = array(); +$features = ''; if (!empty($object->element)) { $features = $object->element; } else { @@ -371,8 +372,11 @@ if (!empty($object->element_for_permission)) { $features .= (empty($object->module) ? '' : '@'.$object->module); } -// Security check -restrictedArea($user, $features, 0, ''); +// $arrayoftype contains several features +// Test on permission can be done on a given selected feature only + +// Security check (do not stop here, get only result to show message later) +$resultcheck = restrictedArea($user, $features, 0, '', '', 'fk_soc', 'rowid', 0, 1); /* @@ -613,6 +617,14 @@ if (count($search_groupby)) { //var_dump($arrayofvaluesforgroupby);exit; +if (!$resultcheck) { + print '
'; + print $langs->trans("NotEnoughPermissions"); + print '
'; +} + + + //$tmparray = dol_getdate(dol_now()); //$endyear = $tmparray['year']; //$endmonth = $tmparray['mon'];