mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
* fix anyone can cancel * Fix cancel button visibility based on user permissions * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -61,7 +61,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$fuserid = (GETPOSTINT('fuserid') ? GETPOSTINT('fuserid') : $user->id);
|
||||
$fuserid = (GETPOSTINT('fuserid') ? GETPOSTINT('fuserid') : ($action == 'create' ? $user->id : 0));
|
||||
$socid = GETPOSTINT('socid');
|
||||
|
||||
// Load translation files required by the page
|
||||
@@ -100,6 +100,9 @@ if (($id > 0) || $ref) {
|
||||
if (!$canread) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($fuserid == 0) {
|
||||
$fuserid = $object->fk_user; // If $fuserid is not defined, set it to the owner of the leave request
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
|
||||
Reference in New Issue
Block a user