Fix: security with multi-company
This commit is contained in:
parent
825f3346c9
commit
8b02eb1f3f
@ -34,17 +34,12 @@ $langs->load("products");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -39,17 +39,12 @@ $langs->load("products");
|
||||
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -41,17 +41,12 @@ $langs->load("other");
|
||||
$langs->load("stocks");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("suppliers");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -35,17 +35,12 @@ $langs->load("products");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -35,17 +35,12 @@ $langs->load("products");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("bills");
|
||||
$langs->load("products");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("products");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("products");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -35,17 +35,12 @@ $langs->load("products");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("bills");
|
||||
$langs->load("products");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -37,17 +37,12 @@ $langs->load("products");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -39,17 +39,12 @@ $langs->load("other");
|
||||
$mode=isset($_GET["mode"])?$_GET["mode"]:'byunit';
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -35,17 +35,12 @@ $langs->load("products");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -37,17 +37,12 @@ $langs->load("orders");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
@ -36,17 +36,12 @@ $langs->load("products");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$id = '';
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["id"];
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if (isset($_GET["ref"]))
|
||||
{
|
||||
$id = $_GET["ref"];
|
||||
$fieldid = 'ref';
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$fieldid = isset($_REQUEST["ref"])?'ref':'rowid';
|
||||
}
|
||||
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user