forked from Wavyzz/dolibarr
amlioration de la scurit
This commit is contained in:
@@ -34,7 +34,30 @@ $langs->load('other');
|
||||
|
||||
|
||||
$mesg = "";
|
||||
$socid=$_GET["socid"];
|
||||
|
||||
// S<>curit<69> acc<63>s client
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
|
||||
if ($socid == '') accessforbidden();
|
||||
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
// Protection restriction commercial
|
||||
if (!$user->rights->commercial->client->voir && $socidp && !$user->societe_id > 0)
|
||||
{
|
||||
$sql = "SELECT sc.fk_soc, s.client";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE fk_soc = ".$socidp." AND fk_user = ".$user->id." AND s.client = 1";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
if ( $db->num_rows() == 0) accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user