Update newpayment.php
This commit is contained in:
parent
c94946b934
commit
420bf440ef
@ -278,11 +278,13 @@ if ($tmpsource == 'membersubscription') {
|
|||||||
}
|
}
|
||||||
$valid = true;
|
$valid = true;
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||||
|
$token = '';
|
||||||
|
$tokenoldcompat = '';
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||||
if ($tmpsource && $REF) {
|
if ($tmpsource && $REF) {
|
||||||
$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
|
$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
|
||||||
if ($SECUREKEY != $token) {
|
if ($tmpsource != $source) {
|
||||||
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module)
|
$tokenoldcompat = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
$token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||||
@ -290,7 +292,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
|||||||
} else {
|
} else {
|
||||||
$token = $conf->global->PAYMENT_SECURITY_TOKEN;
|
$token = $conf->global->PAYMENT_SECURITY_TOKEN;
|
||||||
}
|
}
|
||||||
if ($SECUREKEY != $token) {
|
if ($SECUREKEY != $token && $SECUREKEY != $tokenoldcompat) {
|
||||||
if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) {
|
if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) {
|
||||||
$valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility
|
$valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user