Fix missing return

This commit is contained in:
Laurent Destailleur 2023-04-27 22:49:38 +02:00
parent 684e429872
commit 05307c6667

View File

@ -287,8 +287,8 @@ class MailmanSpip
* Subscribe an email to all mailing-lists
*
* @param Adherent $object Object with data (->email, ->pass, ->element, ->type)
* @param array $listes To force mailing-list (string separated with ,)
* @return int <0 if KO, >=0 if OK
* @param array $listes To force mailing-list (string separated with ,)
* @return int <0 if KO, >=0 if OK
*/
public function add_to_mailman($object, $listes = '')
{
@ -306,7 +306,7 @@ class MailmanSpip
return -1;
}
if ($conf->adherent->enabled) { // Synchro for members
if (isModEnabled('adherent')) { // Synchro for members
if (!empty($conf->global->ADHERENT_MAILMAN_URL)) {
if ($listes == '' && !empty($conf->global->ADHERENT_MAILMAN_LISTS)) {
$lists = explode(',', $conf->global->ADHERENT_MAILMAN_LISTS);
@ -347,6 +347,8 @@ class MailmanSpip
return -1;
}
}
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -374,7 +376,7 @@ class MailmanSpip
return -1;
}
if ($conf->adherent->enabled) { // Synchro for members
if (isModEnabled('adherent')) { // Synchro for members
if (!empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL)) {
if ($listes == '' && !empty($conf->global->ADHERENT_MAILMAN_LISTS)) {
$lists = explode(',', $conf->global->ADHERENT_MAILMAN_LISTS);
@ -415,5 +417,7 @@ class MailmanSpip
return -1;
}
}
return 0;
}
}