mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix CSRF = 3 for cancel and clone
This commit is contained in:
parent
028e5fd1d3
commit
4374ecebad
|
|
@ -3089,7 +3089,7 @@ if ($action == 'create' && $usercancreate) {
|
|||
|
||||
// Clone
|
||||
if ($usercancreate) {
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id.'&socid='.$object->socid, '');
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id.'&socid='.$object->socid, '');
|
||||
}
|
||||
|
||||
// Cancel order
|
||||
|
|
|
|||
|
|
@ -2717,13 +2717,13 @@ if ($action == 'create') {
|
|||
|
||||
// Clone
|
||||
if ($usercancreate) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=order&token='.newToken().'">'.$langs->trans("ToClone").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=order">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) {
|
||||
if ($usercanorder) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel">'.$langs->trans("CancelOrder").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelOrder").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
|
||||
$sensitiveget = false;
|
||||
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
||||
// All GET actions (except the listed exception that are post actions) and mass actions are processed as sensitive.
|
||||
// All GET actions (except the listed exceptions that are usually post for pre-actions and not real action) and mass actions are processed as sensitive.
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude some action that are not sensitive so legitimate
|
||||
$sensitiveget = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1666,7 +1666,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
// Clone
|
||||
if ($user->hasRight('projet', 'creer')) {
|
||||
if ($userWrite > 0) {
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, '');
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.((int) $object->id), '');
|
||||
} else {
|
||||
print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user