Update note.php

This commit is contained in:
Laurent Destailleur 2021-11-30 12:21:21 +01:00 committed by GitHub
parent a3315e8e16
commit 5e55bb20e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,18 +34,22 @@ $action = GETPOST('action', 'aZ09');
// Load translation files required by the page
$langs->load("companies");
// Security check
$id = GETPOST('id', 'int');
//if ($user->socid) {
// $id = $user->socid;
//}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db);
if ($id > 0) {
$object->fetch($id);
}
// Security check
if ($user->socid > 0) {
if ($object->fk_soc > 0 && $object->fk_soc != $user->socid) {
accessforbidden();
}
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context