From b9646fbfbe1f3382d2f18ffb3b59d397786aa4ad Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 26 Feb 2025 02:41:47 +0100 Subject: [PATCH] Debug v21 --- htdocs/contrat/card.php | 5 +++++ htdocs/societe/card.php | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 86a46a1919a..7102d907a6d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -130,8 +130,13 @@ $permissiontoedit = $permissiontoadd; $permissiontoactivate = $user->hasRight('contrat', 'activer'); $error = 0; +// Security check $result = restrictedArea($user, 'contrat', $object->id); +if (!($object->id > 0) && ($action == 'view' || $action == '')) { + recordNotFound(); +} + /* * Actions diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 97ce9aebbc1..20afd8e6ca5 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -154,10 +154,6 @@ if ($socid > 0) { $object->fetch($socid); } -if (!($object->id > 0) && $action == 'view') { - recordNotFound(); -} - // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $canvas = $object->canvas ? $object->canvas : GETPOST("canvas"); $objcanvas = null; @@ -176,8 +172,11 @@ $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the includ $upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check -$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); +$result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0); +if (!($object->id > 0) && $action == 'view') { + recordNotFound(); +} /*