bug fix et mise en place de l'inscription avec mailman
This commit is contained in:
parent
d080e054a6
commit
14529dd608
@ -49,27 +49,35 @@ $sth->execute;
|
|||||||
|
|
||||||
# get emails of adherents
|
# get emails of adherents
|
||||||
while (my @row = $sth->fetchrow_array ){
|
while (my @row = $sth->fetchrow_array ){
|
||||||
print "$row[0]\n";
|
# print "$row[0]\n";
|
||||||
push (@adh,$row[0]);
|
push (@adh,$row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# get emails of mailing-list suscribers
|
# get emails of mailing-list suscribers
|
||||||
@ml_adh=`/usr/sbin/list_members $ml`;
|
@ml_adh=`/usr/sbin/list_members $ml`;
|
||||||
chomp(@ml_adh);
|
chomp(@ml_adh);
|
||||||
|
#foreach (@ml_adh){
|
||||||
|
# print $_;
|
||||||
|
#}
|
||||||
# do the diff
|
# do the diff
|
||||||
foreach my $adh (@adh){
|
foreach my $adh (@adh){
|
||||||
if (!grep(/^$adh$/,@ml_adh)){
|
if (!grep(/^$adh$/i,@ml_adh)){
|
||||||
# user not subscribed
|
# user not subscribed
|
||||||
print "register $adh : echo $adh | /usr/sbin/add_members -n - $ml\n";
|
print "register $adh : echo $adh | /usr/sbin/add_members -n - $ml\n";
|
||||||
|
if (system("echo $adh | /usr/sbin/add_members -n - $ml")){
|
||||||
|
die "can't execute echo $adh | /usr/sbin/add_members -n - $ml : $!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# unsubcribe user not adherent
|
# unsubcribe user not adherent
|
||||||
foreach my $subs (@ml_adh){
|
foreach my $subs (@ml_adh){
|
||||||
if (!grep(/^$subs$/,@adh)){
|
if (!grep(/^$subs$/i,@adh)){
|
||||||
# unsubscrib user
|
# unsubscrib user
|
||||||
print "unsubscribe $subs : /usr/sbin/remove_members $ml $subs\n";
|
print "unsubscribe $subs : /usr/sbin/remove_members $ml $subs\n";
|
||||||
|
if (system("/usr/sbin/remove_members $ml $subs")){
|
||||||
|
die "can't execute /usr/sbin/remove_members $ml $subs : $!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user