From b441c600bb1a9c5fe8daff4df13ba68c836be9fe Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 23 Apr 2021 10:32:28 +0200 Subject: [PATCH] fixing error introduced in a previous commit --- htdocs/compta/paiement.php | 2 +- htdocs/core/class/CMailFile.class.php | 1 + .../class/conferenceorboothattendee.class.php | 1 - htdocs/public/payment/newpayment.php | 4 ++-- htdocs/public/payment/paymentok.php | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 418bca03d83..94b114c03d8 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -253,7 +253,7 @@ if (empty($reshook)) { if (!$error) { // Create payment and update this->multicurrency_amounts if this->amounts filled or // this->amounts if this->multicurrency_amounts filled. - $paiement_id = $paiement->create($user, 1, $thirdparty); // This include closing invoices and regenerating documents + $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty); // This include closing invoices and regenerating documents if ($paiement_id < 0) { setEventMessages($paiement->error, $paiement->errors, 'errors'); $error++; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 526c464403f..863bb9a6794 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -584,6 +584,7 @@ class CMailFile if ($reshook < 0) { $this->error = "Error in hook maildao sendMail ".$reshook; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); + return $reshook; } if ($reshook == 1) { // Hook replace standard code diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index d8e166fde5a..6418d73580b 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -438,7 +438,6 @@ class ConferenceOrBoothAttendee extends CommonObject } $resql = $this->db->query($sql); - if ($resql) { $num = $this->db->num_rows($resql); $i = 0; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2f6b61a82d4..5007b325c11 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -157,7 +157,6 @@ foreach ($_POST as $key => $val) { } - // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -207,6 +206,8 @@ if (!empty($entity)) { $urlok = preg_replace('/&$/', '', $urlok); // Remove last & $urlko = preg_replace('/&$/', '', $urlko); // Remove last & + + // Make special controls if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { @@ -264,7 +265,6 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index cdee63c2955..444a769673c 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -109,6 +109,7 @@ $invoiceref = GETPOST('invoice'); $suffix = GETPOST("suffix", 'aZ09'); $membertypeid = GETPOST("membertypeid", 'int'); + // Detect $paymentmethod $paymentmethod = ''; $reg = array(); @@ -151,6 +152,7 @@ $object = new stdClass(); // For triggers $error = 0; + /* * Actions */