bugfix pfff
This commit is contained in:
parent
a66844976e
commit
8bb656a475
@ -36,31 +36,12 @@ if (!$user->rights->projet->lire) accessforbidden();
|
|||||||
/*
|
/*
|
||||||
* Sécurité accés client
|
* Sécurité accés client
|
||||||
*/
|
*/
|
||||||
$projetid='';
|
|
||||||
if ($_GET["id"]) { $projetid=$_GET["id"]; }
|
|
||||||
|
|
||||||
if ($projetid == '') accessforbidden();
|
|
||||||
|
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Protection restriction commercial
|
|
||||||
if ($projetid)
|
|
||||||
{
|
|
||||||
$sql = "SELECT sc.fk_soc, p.rowid, p.fk_soc";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."projet as p";
|
|
||||||
$sql .= " WHERE p.rowid = ".$projetid;
|
|
||||||
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= " AND sc.fk_soc = p.fk_soc AND fk_user = ".$user->id;
|
|
||||||
if ($socidp) $sql .= " AND p.fk_soc = ".$socidp;
|
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
|
||||||
{
|
|
||||||
if ( $db->num_rows() == 0) accessforbidden();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llxHeader("",$langs->trans("Projects"),"Projet");
|
llxHeader("",$langs->trans("Projects"),"Projet");
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("ProjectsArea"));
|
print_fiche_titre($langs->trans("ProjectsArea"));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user