amlioration de la scurit
This commit is contained in:
parent
8bb656a475
commit
1df49664a3
@ -37,13 +37,29 @@ if ($conf->facture->enabled) $langs->load("bills");
|
|||||||
if ($conf->projet->enabled) $langs->load("projects");
|
if ($conf->projet->enabled) $langs->load("projects");
|
||||||
|
|
||||||
// Sécurité accés client
|
// Sécurité accés client
|
||||||
$socid = $_GET["socid"];
|
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||||
|
|
||||||
|
if ($socid == '') accessforbidden();
|
||||||
|
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$user->getrights('facture');
|
$user->getrights('facture');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,30 @@ $langs->load('other');
|
|||||||
|
|
||||||
|
|
||||||
$mesg = "";
|
$mesg = "";
|
||||||
$socid=$_GET["socid"];
|
|
||||||
|
// Sécurité accé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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -32,6 +32,30 @@ require_once (DOL_DOCUMENT_ROOT."/societe.class.php");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
|
// Sécurité accé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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,12 +32,29 @@ require("pre.inc.php");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
// Sécurité accés client
|
// Sécurité accés client
|
||||||
$socid = $_GET["socid"];
|
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||||
if ($user->societe_id > 0)
|
|
||||||
|
if ($socid == '') accessforbidden();
|
||||||
|
|
||||||
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sortorder=$_GET["sortorder"];
|
$sortorder=$_GET["sortorder"];
|
||||||
$sortfield=$_GET["sortfield"];
|
$sortfield=$_GET["sortfield"];
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|||||||
@ -31,6 +31,29 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
// Protection quand utilisateur externe
|
||||||
|
$socidp = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||||
|
|
||||||
|
if ($socidp == '') accessforbidden();
|
||||||
|
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$socidp = $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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($_POST["action"] == 'add') {
|
if ($_POST["action"] == 'add') {
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".addslashes($_POST["note"])."' WHERE idp=".$_POST["socid"];
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".addslashes($_POST["note"])."' WHERE idp=".$_POST["socid"];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user