diff --git a/htdocs/adherent.class.php b/htdocs/adherent.class.php index fd1bff68a25..715b2ebc981 100644 --- a/htdocs/adherent.class.php +++ b/htdocs/adherent.class.php @@ -110,7 +110,7 @@ class Adherent $this->cp, $this->ville, $this->pays, - $this->email, + $this->email, $this->naiss, $this->photo, $this->login, @@ -1006,11 +1006,15 @@ class Adherent * * */ - Function add_to_mailman() + Function add_to_mailman($listes='') { if (defined("MAIN_MAILMAN_URL") && MAIN_MAILMAN_URL != '' && defined("MAIN_MAILMAN_LISTS") && MAIN_MAILMAN_LISTS != '') { - $lists=explode(',',MAIN_MAILMAN_LISTS); + if ($listes ==''){ + $lists=explode(',',MAIN_MAILMAN_LISTS); + }else{ + $lists=explode(',',$listes); + } foreach ($lists as $list) { // on remplace dans l'url le nom de la liste ainsi @@ -1018,12 +1022,16 @@ class Adherent $patterns = array ( '/%LISTE%/', '/%EMAIL%/', - '/%PASS%/' + '/%PASS%/', + '/%ADMINPW%/', + '/%SERVER%/' ); $replace = array ( $list, $this->email, - $this->pass + $this->pass, + MAIN_MAILMAN_ADMINPW, + MAIN_MAILMAN_SERVER ); $curl_url = preg_replace ($patterns, $replace, MAIN_MAILMAN_URL); @@ -1061,11 +1069,15 @@ class Adherent - Function del_to_mailman() + Function del_to_mailman($listes='') { if (defined("MAIN_MAILMAN_UNSUB_URL") && MAIN_MAILMAN_UNSUB_URL != '' && defined("MAIN_MAILMAN_LISTS") && MAIN_MAILMAN_LISTS != '') { - $lists=explode(',',MAIN_MAILMAN_LISTS); + if ($listes==''){ + $lists=explode(',',MAIN_MAILMAN_LISTS); + }else{ + $lists=explode(',',$listes); + } foreach ($lists as $list) { // on remplace dans l'url le nom de la liste ainsi @@ -1073,12 +1085,16 @@ class Adherent $patterns = array ( '/%LISTE%/', '/%EMAIL%/', - '/%PASS%/' + '/%PASS%/', + '/%ADMINPW%/', + '/%SERVER%/' ); $replace = array ( $list, $this->email, - $this->pass + $this->pass, + MAIN_MAILMAN_ADMINPW, + MAIN_MAILMAN_SERVER ); $curl_url = preg_replace ($patterns, $replace, MAIN_MAILMAN_UNSUB_URL); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 079141f7309..98dd29f5820 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -40,6 +40,11 @@ if ($HTTP_POST_VARS["action"] == 'cotisation') if ($cotisation > 0) { + // rajout du nouveau cotisant dans les listes qui vont bien + // if (defined("MAIN_MAILMAN_LISTS_COTISANT") && MAIN_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == "0000-00-00 00:00:00"){ + if (defined("MAIN_MAILMAN_LISTS_COTISANT") && MAIN_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == 0){ + $adh->add_to_mailman(MAIN_MAILMAN_LISTS_COTISANT); + } $adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation); if (defined("MAIN_MAIL_COTIS") && defined("MAIN_MAIL_COTIS_SUBJECT")){ $adh->send_an_email($adh->email,MAIN_MAIL_COTIS,MAIN_MAIL_COTIS_SUBJECT); diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php index dc9620fe889..4369ea3a608 100644 --- a/htdocs/admin/adherent.php +++ b/htdocs/admin/adherent.php @@ -105,6 +105,9 @@ if (defined("MAIN_USE_MAILMAN") && MAIN_USE_MAILMAN == 1) print ''; // Edition des varibales globales rattache au theme Mailman $constantes=array('MAIN_MAILMAN_LISTS', + 'MAIN_MAILMAN_LISTS_COTISANT', + 'MAIN_MAILMAN_ADMINPW', + 'MAIN_MAILMAN_SERVER', 'MAIN_MAILMAN_UNSUB_URL', 'MAIN_MAILMAN_URL' ); diff --git a/mysql/migration/0.5.1-0.5.2.sql b/mysql/migration/0.5.1-0.5.2.sql index f4371e74d4d..e0f129adda5 100644 --- a/mysql/migration/0.5.1-0.5.2.sql +++ b/mysql/migration/0.5.1-0.5.2.sql @@ -7,3 +7,8 @@ insert into llx_const(name, value, type, note, visible) values ('ADH_TEXT_NEW_AD insert into llx_const(name, value, type, note, visible) values ('ADH_CARD_HEADER_TEXT','%ANNEE%','string','Texte imprime sur le haut de la carte adherent',0); insert into llx_const(name, value, type, note, visible) values ('ADH_CARD_FOOTER_TEXT','Association FreeLUG http://www.freelug.org/','string','Texte imprime sur le bas de la carte adherent',0); insert into llx_const(name, value, type, note, visible) values ('ADH_CARD_TEXT','%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','texte','Texte imprime sur la carte adherent',0); +insert into llx_const(name, value, type, note, visible) values ('MAIN_MAILMAN_ADMINPW','','string','Mot de passe Admin des liste mailman',0); +insert into llx_const(name, value, type, note, visible) values ('MAIN_MAILMAN_SERVER','lists.ipsyn.net','string','Serveur hebergeant les interfaces d\'Admin des listes mailman',0); +replace into llx_const(name, value, type, note, visible) values ('MAIN_MAILMAN_UNSUB_URL','http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&user=%EMAIL%','chaine','Url de desinscription aux listes mailman',0); +replace into llx_const(name, value, type, note, visible) values ('MAIN_MAILMAN_URL','http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine','url pour les inscriptions mailman',0); +insert into llx_const(name, value, type, note, visible) values ('MAIN_MAILMAN_LISTS_COTISANT','','string','Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement',0);