From 2303de316250136920a633184252ad95dbe8561c Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Fri, 16 Oct 2009 13:15:26 +0000
Subject: [PATCH] Fix: just one & its ok :)

---
 htdocs/categories/categorie.php  | 4 ++--
 htdocs/lib/functions.lib.php     | 2 +-
 htdocs/product/barcode.php       | 2 +-
 htdocs/product/fournisseurs.php  | 2 +-
 htdocs/product/stock/product.php | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index aabbbf9832d..3aa38deeec2 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -39,14 +39,14 @@ if ($_REQUEST["socid"])
 {
 	if ($_REQUEST["typeid"] == 1) { $type = 'fournisseur'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; }
 	if ($_REQUEST["typeid"] == 2) { $type = 'societe'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; }
-	$objecttype = 'societe&&categorie';
+	$objecttype = 'societe&categorie';
 	$objectid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:'';
 	$fieldid = 'rowid';
 }
 else if ($_REQUEST["id"] || $_REQUEST["ref"])
 {
 	$type = 'produit';
-	$objecttype = 'produit|service&&categorie';
+	$objecttype = 'produit|service&categorie';
 	$objectid = isset($_REQUEST["id"])?$_REQUEST["id"]:(isset($_REQUEST["ref"])?$_REQUEST["ref"]:'');
 	$dbtablename = 'product';
 	$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index a6094a3f220..2527c962e76 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -1518,7 +1518,7 @@ function restrictedArea($user, $features='societe', $objectid=0, $dbtablename=''
 	//print ", user_societe_contact_lire=".$user->rights->societe->contact->lire."<br>";
 	
 	// More features to check
-	$features = explode("&&",$features);
+	$features = explode("&",$features);
 	
 	// Check read permission from module
 	// TODO Replace "feature" param by permission for reading
diff --git a/htdocs/product/barcode.php b/htdocs/product/barcode.php
index cb765b50b45..4e7e7ae650b 100644
--- a/htdocs/product/barcode.php
+++ b/htdocs/product/barcode.php
@@ -40,7 +40,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
 }
 $fieldid = isset($_GET["ref"])?'ref':'rowid';
 if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'produit|service&&barcode',$id,'product','','',$fieldid);
+$result=restrictedArea($user,'produit|service&barcode',$id,'product','','',$fieldid);
 
 /*
  * Actions
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 01598cb1b19..e3e89dbb793 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -50,7 +50,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
 }
 $fieldid = isset($_GET["ref"])?'ref':'rowid';
 if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'produit|service&&fournisseur',$id,'product','','',$fieldid);
+$result=restrictedArea($user,'produit|service&fournisseur',$id,'product','','',$fieldid);
 
 $mesg = '';
 
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index a01e1538db7..75413e9d35d 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -43,7 +43,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
 }
 $fieldid = isset($_GET["ref"])?'ref':'rowid';
 if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'produit&&stock',$id,'product','','',$fieldid);
+$result=restrictedArea($user,'produit&stock',$id,'product','','',$fieldid);
 
 $mesg = '';
 
-- 
GitLab