return unless $list;
my $error;
sub (/) {
- $self->_list_dispatchers($list, \$error),
+ $self->_list_dispatchers($current_user, $list, \$error),
sub () { $self->_render_list_page($list, $error) };
},
sub (/deny/|/allow/|/mod/|/digest/) {
sub (/*/) {
my $sublist = $list->${\$_[1]};
- $self->_list_dispatchers($sublist, \$error),
+ $self->_list_dispatchers($current_user, $sublist, \$error),
sub () { $self->_render_sublist_page($sublist, $error) };
},
},
}
}
+sub audit_action {
+ my ($self, $user, $list, $action, $on) = @_;
+ print STDERR "${user} called ${action} ${on} for ${list}\n";
+}
+
sub _list_dispatchers {
- my ($self, $list, $error_ref) = @_;
+ my ($self, $current_user, $list, $error_ref) = @_;
+ my $name = $current_user->username;
sub (POST) {
sub (%add=) {
+ $self->audit_action($name, $list->name, 'add', $_[1]);
eval { $list->add_member($_[1]); 1 }
or ${$error_ref} = $@;
return;
},
sub (%remove=) {
+ $self->audit_action($name, $list->name, 'remove', $_[1]);
eval { $list->remove_member($_[1]); 1 }
or ${$error_ref} = $@;
return;