From 25c2e53dca963864e94500bfd15b59cea26e7eca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 8 Jun 2007 08:38:02 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20mise=20en=20fonction=20de=20la=20v=E9rif?= =?UTF-8?q?ication=20des=20droits=20d'acc=E8s=20users,=20clients=20et=20co?= =?UTF-8?q?mmerciaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/clients.php | 2 +- htdocs/lib/functions.inc.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index 5b7186b68dc..77429b65135 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -30,7 +30,7 @@ require("./pre.inc.php"); // Sécurité d'accès client et commerciaux -$socid = restrictedArea($user, 'societe'); +$socid = restrictedArea($user, 'societe','','',1); $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 1d38d2b29f4..c99a683de37 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1253,6 +1253,7 @@ function dol_loginfunction($notused,$pearstatus) * \param module Module à vérifier * \param objectid ID du document * \param dbtable Table de la base correspondant au module (optionnel) + * \param list Défini si la page sert de liste et donc ne fonctionne pas avec un id */ function restrictedArea($user, $modulename, $objectid='', $dbtablename='', $list=0) { @@ -1262,8 +1263,7 @@ function dol_loginfunction($notused,$pearstatus) $user->getrights('commercial'); $socid = 0; - $nocreate = 0; - if ($modulename == 'societe' && $objectid) $socid = $objectid; + $nocreate = 0; //si dbtable non défini, même nom que le module if (!$dbtable) $dbtablename = $modulename; @@ -1320,7 +1320,7 @@ function dol_loginfunction($notused,$pearstatus) { accessforbidden(); } - return $socid; + return $objectid; }