diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e59389a87b7..2372f24a929 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -227,13 +227,13 @@ if (empty($reshook)) { $substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid; $onlinepaymentenabled = 0; - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $onlinepaymentenabled++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $onlinepaymentenabled++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $onlinepaymentenabled++; } if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { @@ -263,7 +263,7 @@ if (empty($reshook)) { $substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = ''.$langs->trans('BlankSubscriptionForm'). ''; } /* For backward compatibility, deprecated */ - if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) { + if (isModEnabled('paypal') && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) { $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fe82b9e7f1..1465b60b2f6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5802,7 +5802,7 @@ if ($action == 'create') { // Show online payment link - $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); + $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox')); if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { print '
'."\n"; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a2abdbb7cc6..ad25db01fa6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1619,13 +1619,13 @@ class FormMail extends Form //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing $onlinepaymentenabled = 0; - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $onlinepaymentenabled++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $onlinepaymentenabled++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $onlinepaymentenabled++; } if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index d48775fe84e..83359ef1c65 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -27,7 +27,7 @@ $supportedoauth2array = array( 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'), ); -if (!empty($conf->stripe->enabled)) { +if (isModEnabled('stripe')) { $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 19a251d1b38..44691f7c2c4 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -150,15 +150,15 @@ function getValidOnlinePaymentMethods($paymentmethod = '') $validpaymentmethod = array(); - if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal')) { $langs->load("paypal"); $validpaymentmethod['paypal'] = 'valid'; } - if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'paybox') && isModEnabled('paybox')) { $langs->load("paybox"); $validpaymentmethod['paybox'] = 'valid'; } - if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) { + if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) { $langs->load("stripe"); $validpaymentmethod['stripe'] = 'valid'; }