[prev] [thread] [next] [lurker] [Date index for 2003/07/28]
Author: simon Date: 2003-07-28 17:31:47 +0100 (Mon, 28 Jul 2003) New Revision: 1262 Modified: trunk/siesta/lib/Siesta/Plugin/MembersOnly.pm trunk/siesta/t/10plugin_membersonly.t Log: Add allowed_posters Modified: trunk/siesta/lib/Siesta/Plugin/MembersOnly.pm ============================================================================== --- trunk/siesta/lib/Siesta/Plugin/MembersOnly.pm 2003-07-28 14:32:20 UTC (rev 1261) +++ trunk/siesta/lib/Siesta/Plugin/MembersOnly.pm 2003-07-28 16:31:47 UTC (rev 1262) @@ -15,6 +15,9 @@ return if $list->is_member( $mail->from ); + return if grep { $mail->from eq $_ } split ' ', $self->pref('allowed_posters'); + + # I'm not even supposed to be here today. my $extra = ''; if ($self->pref('approve')) { @@ -63,6 +66,12 @@ type => "boolean", default => 0, }, + 'allowed_posters' + => { + description => "people allowed to post who aren't on the system", + type => "string", + default => "", + }, }; } Modified: trunk/siesta/t/10plugin_membersonly.t ============================================================================== --- trunk/siesta/t/10plugin_membersonly.t 2003-07-28 14:32:20 UTC (rev 1261) +++ trunk/siesta/t/10plugin_membersonly.t 2003-07-28 16:31:47 UTC (rev 1262) @@ -1,7 +1,7 @@ #!perl -w # $Id: 10plugin_membersonly.t,v 1.15 2003/03/26 07:16:42 muttley Exp $ use strict; -use Test::More tests => 6; +use Test::More tests => 7; use lib qw(t/lib); use Siesta::Test; @@ -42,9 +42,16 @@ ok( $plugin->process($mail), "rejected dante" ); like( $message{'body'}, qr{$list_id MembersOnly dropped a message from $mail_from}, "said why" ); + + $mail->from_raw('jack.black@holywood'); ok( $plugin->process($mail), "jack.black isn't even on the system" ); + +$plugin->pref('allowed_posters','dante@quick-stop jack.black@holywood'); +ok( !$plugin->process($mail), "accepted jack.black as an allowed user" ); + + $mail->from_raw('jay@xxxxxxxx.xxxxxxxxxx'); ok( !$plugin->process($mail), "accepted jay" );
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52