From 99607073e3b2103ffcc497f65f7ad884cb2b65fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 01:16:29 +0200 Subject: [PATCH] Fix: Some fixes for the autosubscription to mailing-lists --- .../mailmanspip/class/mailmanspip.class.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 5032edca416..dff11b3149a 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -106,11 +106,12 @@ class MailmanSpip /** * Function used to connect to Mailman * - * @param object $object Object with the data - * @param string $url Mailman URL to be called with patterns - * @return mixed Boolean or string + * @param object $object Object with the data + * @param string $url Mailman URL to be called with patterns + * @param string $list Name of mailing-list + * @return mixed Boolean or string */ - function callMailman($object, $url) + private function callMailman($object, $url, $list) { global $conf; @@ -329,7 +330,7 @@ class MailmanSpip } //We call Mailman to subscribe the user - $result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_URL); + $result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_URL, $list); if ($result === false) { @@ -373,14 +374,16 @@ class MailmanSpip $tmp=explode(':',$list); if (! empty($tmp[1])) { - if ($object->element == 'member' && $object->type != $tmp[1]) // Filter on member type label + $list=$tmp[1]; + if ($object->element == 'member' && $object->type != $tmp[1]) // Filter on member type label { - continue; + dol_syslog("We ignore list ".$list." because object member type ".$object->type." does not match ".$tmp[0], LOG_DEBUG); + continue; } } //We call Mailman to unsubscribe the user - $result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_UNSUB_URL); + $result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_UNSUB_URL, $list); if ($result === false) {