FIX reception/note.php and contact.php: wrong object passed to restrictedArea causing random access denied (#38604)
Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
This commit is contained in:
parent
c549b38e56
commit
5ffdb271dc
2 changed files with 6 additions and 6 deletions
|
|
@ -83,11 +83,11 @@ if ($user->socid > 0) {
|
|||
|
||||
// TODO Test on reception module on only
|
||||
$result = -1;
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
if (isModEnabled("reception") || $origin == 'reception' || empty($origin)) {
|
||||
$result = restrictedArea($user, 'reception', $object->id);
|
||||
} else {
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande');
|
||||
$result = restrictedArea($user, 'fournisseur', $object->origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (!$user->hasRight($origin, 'lire') && !$user->hasRight($origin, 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ if (isModEnabled("reception")) {
|
|||
$permissionnote = $user->hasRight('reception', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// TODO Test on reception module on only
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
if (isModEnabled("reception") || $origin == 'reception' || empty($origin)) {
|
||||
$result = restrictedArea($user, 'reception', $object->id);
|
||||
} else {
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande');
|
||||
$result = restrictedArea($user, 'fournisseur', $object->origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (!$user->hasRight($origin, 'lire') && !$user->hasRight($origin, 'read')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue