0000575: Sécurité: limiter dépot

This commit is contained in:
Dany De Bontridder 2012-06-13 19:48:49 +00:00
parent 821f5e93e3
commit ffb3d3bf06
6 changed files with 205 additions and 2 deletions

View file

@ -58,6 +58,41 @@ if (isset($_POST['change_profile']))
}
}
//**********************************************
// Save avail. profiles
//**********************************************
if (isset($_POST['change_stock']))
{
extract($_POST);
try
{
for ($e = 0; $e < count($right); $e++)
{
if ($right[$e] == 'X' && $ur_id[$e]=='')
continue;
if ($right[$e] == 'X' && $ur_id[$e]!='')
{
$cn->exec_sql("delete from user_sec_repository where p_id=$1 and r_id=$2", array($p_id, $ar_id[$e]));
continue;
}
if ($ur_id[$e] == "")
{
$cn->exec_sql("insert into user_sec_repository (p_id,r_id,ur_right) values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e]));
continue;
}
if ($ur_id[$e] != '')
{
$cn->exec_sql("update user_sec_repository set ur_right=$3 where p_id=$1 and r_id=$2 ", array($p_id, $ar_id[$e], $right[$e]));
continue;
}
}
}
catch (Exception $exc)
{
echo $exc->getTraceAsString();
throw $exc;
}
}
//**********************************************
// Save_name
// *********************************************