Fix: security with multi-company

This commit is contained in:
Regis Houssin 2009-05-04 08:42:29 +00:00
parent 825f3346c9
commit 8b02eb1f3f
16 changed files with 64 additions and 144 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);