amlioration de la scurit
This commit is contained in:
parent
3c97a3c15d
commit
a66844976e
@ -43,11 +43,31 @@ if (!$user->rights->projet->lire) accessforbidden();
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
$projetid='';
|
||||
if ($_GET["id"]) { $projetid=$_GET["id"]; }
|
||||
|
||||
if ($projetid == '') accessforbidden();
|
||||
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$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("","../");
|
||||
|
||||
|
||||
@ -34,6 +34,35 @@ require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
$projetid='';
|
||||
if ($_GET["id"]) { $projetid=$_GET["id"]; }
|
||||
|
||||
if ($projetid == '') accessforbidden();
|
||||
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($_POST["action"] == 'add' && $user->rights->projet->creer)
|
||||
{
|
||||
$pro = new Project($db);
|
||||
|
||||
@ -33,12 +33,34 @@ $langs->load("projects");
|
||||
|
||||
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)
|
||||
{
|
||||
$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");
|
||||
|
||||
print_fiche_titre($langs->trans("ProjectsArea"));
|
||||
|
||||
@ -44,11 +44,31 @@ if (!$user->rights->projet->lire) accessforbidden();
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
$projetid='';
|
||||
if ($_GET["id"]) { $projetid=$_GET["id"]; }
|
||||
|
||||
if ($projetid == '') accessforbidden();
|
||||
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$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("","../");
|
||||
|
||||
|
||||
@ -36,12 +36,31 @@ if (!$user->rights->projet->lire) accessforbidden();
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
$projetid='';
|
||||
if ($_GET["id"]) { $projetid=$_GET["id"]; }
|
||||
|
||||
if ($projetid == '') accessforbidden();
|
||||
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
||||
Function PLines(&$inc, $parent, $lines, &$level, $actors)
|
||||
{
|
||||
$form = new Form($db); // $db est null ici mais inutile pour la fonction select_date()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user