Ajout droits

This commit is contained in:
Rodolphe Quiedeville 2003-08-06 12:07:24 +00:00
parent b339466b2d
commit ead6c895f7

View File

@ -20,20 +20,25 @@
* *
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
$user->getrights('produit');
if (strlen($type) == 0) if (strlen($type) == 0)
{ {
$type = 0; $type = 0;
} }
$db = new Db();
if ($action == 'update') if ($action == 'update')
{ {
$sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid"; $sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid";
$db->query($sql); $db->query($sql);
} }
/*
*
*
*/
if ($page == -1) { if ($page == -1) {
$page = 0 ; $page = 0 ;
} }
@ -60,12 +65,22 @@ if ($snom)
{ {
$sql .= " AND lower(p.label) like '%".strtolower($snom)."%'"; $sql .= " AND lower(p.label) like '%".strtolower($snom)."%'";
} }
if ($user->rights->produit->lire == 0)
{
// sécurité
$sql .= " AND 1 = 2";
}
$sql .= " ORDER BY $sortfield $sortorder "; $sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit($limit + 1 ,$offset); $sql .= $db->plimit($limit + 1 ,$offset);
$result = $db->query($sql) ;
if ( $db->query($sql) ) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
if ($num == 1) if ($num == 1)