Commit f554fa64 authored by sikeda's avatar sikeda
Browse files

[-bug] Held subscription / signoff requests won't be removed when a request is...

[-bug] Held subscription / signoff requests won't be removed when a request is approved using web interface.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12833 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 8ab7cba7
......@@ -7912,19 +7912,6 @@ sub do_add {
return 'info';
}
 
# Delete subscription requests if any
my $spool_req =
Sympa::Spool::Auth->new(context => $list, action => 'add');
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next
unless $request
and grep { $request->{email} eq $_ } @added_users;
$spool_req->remove($handle);
}
Sympa::Report::notice_report_web('add_performed', {'total' => $total},
$param->{'action'});
web_db_log(
......@@ -8053,7 +8040,6 @@ sub do_add_fromsub {
);
}
} else {
# Delete subscription request.
$spool_req->remove($handle);
web_db_log({target => $request->{email}, status => 'success'});
$total++;
......@@ -8196,10 +8182,6 @@ sub do_del {
return undef;
}
 
# Not yet implemented.
# ## Delete signoff request if any
# $list->delete_signoff_request(@removed_users);
Sympa::Report::notice_report_web('del_performed', {'total' => $total},
$param->{'action'});
 
......@@ -8287,7 +8269,6 @@ sub do_del_fromsig {
{sig => $request->{email}},
$param->{'action'}, $list, $param->{'user'}{'email'}, $robot);
} else {
# Delete signoff request.
$spool_req->remove($handle);
web_db_log({target => $request->{email}, status => 'success'});
$total++;
......
......@@ -54,6 +54,7 @@ use Sympa::Regexps;
use Sympa::Robot;
use Sympa::Scenario;
use Sympa::Spindle::ProcessTemplate;
use Sympa::Spool::Auth;
use Sympa::Task;
use Sympa::Template;
use Sympa::Ticket;
......@@ -2082,6 +2083,20 @@ sub delete_list_member {
next;
}
# Delete signoff requests if any.
my $spool_req = Sympa::Spool::Auth->new(
context => $self,
action => 'del',
email => $who,
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
#log in stat_table to make statistics
if ($operation) {
$log->add_stat(
......@@ -3627,6 +3642,42 @@ sub update_list_member {
}
}
# Delete subscription / signoff requests no longer used.
my $new_email;
if ($who ne '*' and $values->{'email'}
and $new_email = Sympa::Tools::Text::canonic_email($values->{'email'})
and $who ne $new_email) {
my $spool_req;
# Delete signoff requests if any.
$spool_req = Sympa::Spool::Auth->new(
context => $self,
action => 'del',
email => $who,
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
# Delete subscription requests if any.
$spool_req = Sympa::Spool::Auth->new(
context => $self,
action => 'add',
email => $new_email,
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
}
# Rename picture on disk if user email changed.
if ($values->{'email'}) {
foreach my $path ($self->find_picture_paths($who)) {
......@@ -3976,6 +4027,21 @@ sub add_list_member {
);
next;
}
# Delete subscription requests if any.
my $spool_req = Sympa::Spool::Auth->new(
context => $self,
action => 'add',
email => $who,
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
$self->{'add_outcome'}{'added_members'}++;
$self->{'add_outcome'}{'remaining_member_to_add'}--;
$current_list_members_count++;
......
......@@ -31,7 +31,6 @@ use Time::HiRes qw();
use Sympa;
use Sympa::Language;
use Sympa::Log;
use Sympa::Spool::Auth;
use Sympa::Tools::Password;
use Sympa::User;
......@@ -98,19 +97,6 @@ sub _twist {
return undef;
}
my $spool_req = Sympa::Spool::Auth->new(
context => $list,
email => $email,
action => 'add'
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
$self->add_stash($request, 'notice', 'now_subscriber',
{'email' => $email});
......
......@@ -31,7 +31,6 @@ use Time::HiRes qw();
use Sympa;
use Sympa::Language;
use Sympa::Log;
use Sympa::Spool::Auth;
use base qw(Sympa::Request::Handler);
......@@ -67,9 +66,8 @@ sub _twist {
}
# Really delete and rewrite to disk.
my $u;
unless (
$u = $list->delete_list_member(
$list->delete_list_member(
'users' => [$who],
'exclude' => ' 1',
'operation' => 'del'
......@@ -87,19 +85,6 @@ sub _twist {
);
$self->add_stash($request, 'intern');
return undef;
} else {
my $spool_req = Sympa::Spool::Auth->new(
context => $list,
email => $who,
action => 'del'
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
}
## Send a notice to the removed user, unless the owner indicated
......
......@@ -903,19 +903,6 @@ sub add {
die SOAP::Fault->faultcode('Server')
->faultstring('Unable to add user')->faultdetail($error);
}
my $spool_req = Sympa::Spool::Auth->new(
context => $list,
email => $email,
action => 'add'
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
}
## Now send the welcome file to the user if it exists and notification is
......@@ -1033,9 +1020,8 @@ sub del {
}
# Really delete and rewrite to disk.
my $u;
unless (
$u = $list->delete_list_member(
$list->delete_list_member(
'users' => [$email],
'exclude' => '1',
'operation' => 'del'
......@@ -1047,19 +1033,6 @@ sub del {
die SOAP::Fault->faultcode('Server')
->faultstring('Unable to remove subscriber information')
->faultdetail('Database access failed');
} else {
my $spool_req = Sympa::Spool::Auth->new(
context => $list,
email => $email,
action => 'del'
);
while (1) {
my ($request, $handle) = $spool_req->next;
last unless $handle;
next unless $request;
$spool_req->remove($handle);
}
}
## Send a notice to the removed user, unless the owner indicated
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment