From b08354b14561f9f443d85aa2f79de683be8cda52 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 10 Mar 2006 08:20:41 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20permission=20"consulter=20tou?= =?UTF-8?q?s=20les=20clients"=20dans=20le=20module=20commercial,=20afin=20?= =?UTF-8?q?=20qu'un=20commercial=20puisse=20voir=20que=20les=20clients=20q?= =?UTF-8?q?ui=20lui=20sont=20affect=E9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/fiche.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 18cae08c936..7e18bf08193 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -52,6 +52,20 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } +// Protection restriction commercial +if (!$user->rights->commercial->client->voir && $socidp) +{ + $sql = "SELECT sc.fk_soc, sc.fk_user"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE sc.fk_soc = ".$socidp." AND sc.fk_user = ".$user->id; + + $resultp=$db->query($sql); + if (!$resultp) + { + accessforbidden(); + } +} + $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"];