Fix: change _REQUEST with GETPOST for _COOKIE problem

This commit is contained in:
Regis Houssin 2010-11-07 22:02:35 +00:00
parent 70e47a9342
commit a2f4671380
2 changed files with 19 additions and 19 deletions

View File

@ -33,31 +33,31 @@ $langs->load("categories");
// Security check
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid'];
$socid=GETPOST('socid');
if (!$user->rights->categorie->lire) accessforbidden();
if (isset ($_REQUEST['choix']))
if (GETPOST('choix'))
{
$nbcats = $_REQUEST['choix'];
$nbcats = GETPOST('choix');
}
else
{ // par default, une nouvelle categorie sera dans une seule categorie mere
$nbcats = 1;
}
if ($_REQUEST['origin'])
if (GETPOST('origin'))
{
if ($_GET['type'] == 0) $idProdOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 1) $idSupplierOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 2) $idCompanyOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 3) $idMemberOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 0) $idProdOrigin = GETPOST('origin');
if ($_GET['type'] == 1) $idSupplierOrigin = GETPOST('origin');
if ($_GET['type'] == 2) $idCompanyOrigin = GETPOST('origin');
if ($_GET['type'] == 3) $idMemberOrigin = GETPOST('origin');
}
if ($_REQUEST['catorigin'])
if (GETPOST('catorigin'))
{
if ($_GET['type'] == 0) $idCatOrigin = $_REQUEST['catorigin'];
if ($_GET['type'] == 0) $idCatOrigin = GETPOST('catorigin');
}
$urlfrom=isset($_REQUEST["urlfrom"])?$_REQUEST["urlfrom"]:'';
$urlfrom=GETPOST("urlfrom");
/*
@ -198,15 +198,15 @@ if ($user->rights->categorie->creer)
print '<input type="hidden" name="urlfrom" value="'.$urlfrom.'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="addcat" value="addcat">';
print '<input type="hidden" name="id" value="'.$_REQUEST['origin'].'">';
print '<input type="hidden" name="id" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="type" value="'.$_GET['type'].'">';
if ($_REQUEST['origin'])
if (GETPOST('origin'))
{
print '<input type="hidden" name="origin" value="'.$_REQUEST['origin'].'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
}
if ($_REQUEST['catorigin'])
if (GETPOST('catorigin'))
{
print '<input type="hidden" name="catorigin" value="'.$_REQUEST['catorigin'].'">';
print '<input type="hidden" name="catorigin" value="'.GETPOST('catorigin').'">';
}
print '<input type="hidden" name="nom" value="'.dol_escape_htmltag($nom).'">';
@ -235,7 +235,7 @@ if ($user->rights->categorie->creer)
// Parent category
print '<tr><td>'.$langs->trans ("AddIn").'</td><td>';
print $html->select_all_categories($_GET['type'],$_REQUEST['catorigin']);
print $html->select_all_categories($_GET['type'],GETPOST('catorigin'));
print '</td></tr>';
print '</table>';

View File

@ -37,14 +37,14 @@ if (! $user->rights->categorie->lire)
$mesg = '';
if ($_REQUEST['id'] == "")
if (GETPOST('id') == "")
{
dol_print_error('','Missing parameter id');
exit();
}
$c = new Categorie($db);
$result=$c->fetch($_REQUEST['id']);
$result=$c->fetch(GETPOST('id'));
if ($result <= 0)
{
dol_print_error($db,$c->error);