Fix securekey
This commit is contained in:
parent
2caaa52e85
commit
531dee31fd
@ -254,11 +254,15 @@ $parameters = [
|
|||||||
$reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action);
|
||||||
|
|
||||||
// Check security token
|
// Check security token
|
||||||
|
$tmpsource = $source;
|
||||||
|
if ($tmpsource == 'membersubscription') {
|
||||||
|
$tmpsource = 'member';
|
||||||
|
}
|
||||||
$valid = true;
|
$valid = true;
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||||
if ($source && $REF) {
|
if ($tmpsource && $REF) {
|
||||||
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||||
} else {
|
} else {
|
||||||
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||||
}
|
}
|
||||||
@ -770,7 +774,7 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
|||||||
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||||
|
|
||||||
// Check link validity
|
// Check link validity
|
||||||
if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) {
|
if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref));
|
dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref));
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user