FIX #yogosha13770

This commit is contained in:
Laurent Destailleur 2022-12-02 11:30:37 +01:00
parent a4f3740e19
commit 39cd6bfcee
6 changed files with 40 additions and 23 deletions

View File

@ -48,6 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->loadLangs(array('bills', 'companies', 'donations', 'users'));
$id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
@ -58,10 +59,11 @@ $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$public_donation = (int) GETPOST("public", 'int');
$object = new Don($db);
$extrafields = new ExtraFields($db);
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
// Security check
$result = restrictedArea($user, 'don', $id);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -71,6 +73,11 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
$hookmanager->initHooks(array('doncard', 'globalcard'));
$upload_dir = $conf->don->dir_output;
// Security check
$result = restrictedArea($user, 'don', $object->id);
$permissiontoadd = $user->rights->don->creer;

View File

@ -49,13 +49,6 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'don', $id, '');
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@ -74,13 +67,20 @@ if (!$sortfield) {
$sortfield = "name";
}
$object = new Don($db);
$object->fetch($id, $ref);
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
$upload_dir = $conf->don->dir_output.'/'.get_exdir($id, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'don';
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'don', $object->id);
$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php

View File

@ -35,11 +35,11 @@ $hookmanager->initHooks(array('donationindex'));
$langs->load("donations");
$donation_static = new Don($db);
// Security check
$result = restrictedArea($user, 'don');
$donation_static = new Don($db);
/*
* Actions

View File

@ -38,14 +38,17 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$object = new Don($db);
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'don', $id, '');
$result = restrictedArea($user, 'don', $object->id);
$object = new Don($db);
$object->fetch($id);
/*

View File

@ -88,6 +88,11 @@ $fieldstosearchall = array(
'd.firstname'=>'Firstname',
);
// Security check
$result = restrictedArea($user, 'don');
/*
* View

View File

@ -43,17 +43,19 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$hookmanager->initHooks(array('donnote'));
$object = new Don($db);
if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
// Security check
$socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('donnote'));
$result = restrictedArea($user, 'don', $id, '');
$object = new Don($db);
$object->fetch($id);
$result = restrictedArea($user, 'don', $object->id, '');
$permissionnote = $user->rights->don->creer; // Used by the include of actions_setnotes.inc.php