Fix: amlioration de la restriction des commerciaux qui pouvait interfrer avec les utilisateurs externe
This commit is contained in:
parent
61be5385ce
commit
5a759d1564
@ -73,22 +73,25 @@ if ($_GET['propalid'] > 0)
|
||||
dolibarr_print_error($db,$propal->error);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Protection restriction commercial
|
||||
if (!$user->rights->commercial->client->voir)
|
||||
if ($user->societe_id > 0 && $propal->socid <> $user->societe_id)
|
||||
{
|
||||
$sql = "SELECT sc.fk_soc";
|
||||
accessforbidden();
|
||||
}
|
||||
// Protection restriction commercial
|
||||
else if (!$user->rights->commercial->client->voir)
|
||||
{
|
||||
$sql = "SELECT sc.fk_soc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE sc.fk_soc = ".$propal->socid." AND sc.fk_user = ".$user->id;
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
if ( $db->num_rows() == 0) accessforbidden();
|
||||
if ( $db->num_rows() == 0)
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
//fin de Protection restriction commercial
|
||||
|
||||
if ($user->societe_id > 0 && $propal->socid <> $user->societe_id)
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Nombre de ligne pour choix de produit/service prédéfinis
|
||||
|
||||
Loading…
Reference in New Issue
Block a user