summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-04-06 14:46:13 +0000
committerfukachan <fukachan>2002-04-06 14:46:13 +0000
commitbb4a8371c705d63276e4e04bdd87e959e4618335 (patch)
tree2f43440760f638958d48513f6fd3f64545fd8132 /fml/lib
parent3aa7b4c3073f3996e0eead9dd087ead750ca6d02 (diff)
downloadfml8-bb4a8371c705d63276e4e04bdd87e959e4618335.tar.gz
fml8-bb4a8371c705d63276e4e04bdd87e959e4618335.tar.bz2
fml8-bb4a8371c705d63276e4e04bdd87e959e4618335.zip
clean up
log more delayed loading by eval { use .. }
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Command/User/unsubscribe.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/fml/lib/FML/Command/User/unsubscribe.pm b/fml/lib/FML/Command/User/unsubscribe.pm
index 5be7ff8b..839afb00 100644
--- a/fml/lib/FML/Command/User/unsubscribe.pm
+++ b/fml/lib/FML/Command/User/unsubscribe.pm
@@ -4,20 +4,16 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: unsubscribe.pm,v 1.8 2002/02/17 08:13:25 fukachan Exp $
+# $FML: unsubscribe.pm,v 1.9 2002/02/18 14:14:53 fukachan Exp $
#
package FML::Command::User::unsubscribe;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp;
-
-
-
use FML::Log qw(Log LogWarn LogError);
-
=head1 NAME
FML::Command::User::unsubscribe - unsubscribe member
@@ -74,7 +70,7 @@ sub process
my $command = $command_args->{ command };
my $address = $curproc->{ credential }->sender();
- # fundamental check
+ # cheap sanity checks
croak("\$member_map is not specified") unless $member_map;
croak("\$recipient_map is not specified") unless $recipient_map;
@@ -84,12 +80,20 @@ sub process
# if not member, unsubscriber request is wrong.
unless ($cred->is_member($curproc, { address => $address })) {
$curproc->reply_message_nl('error.not_member');
+ LogError("unsubscribe request from not member");
croak("not member");
}
# try confirmation before unsubscribe
else {
Log("unsubscriber request, try confirmation");
- use FML::Confirm;
+ eval q{
+ use FML::Confirm;
+ };
+ if ($@) {
+ LogError("tail to load FML::Confirm");
+ croak($@);
+ }
+
my $confirm = new FML::Confirm {
keyword => $keyword,
cache_dir => $cache_dir,