summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command/UserControl.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-07-24 09:27:15 +0000
committerfukachan <fukachan>2002-07-24 09:27:15 +0000
commit8e49892e39d6dc1f9b41dd9cddd9a23a628b0e06 (patch)
tree2130f8fada1088d89db2211985f0fae080057f49 /fml/lib/FML/Command/UserControl.pm
parent15d93611567173e065df480a121d6768cc5b715b (diff)
downloadfml8-8e49892e39d6dc1f9b41dd9cddd9a23a628b0e06.tar.gz
fml8-8e49892e39d6dc1f9b41dd9cddd9a23a628b0e06.tar.bz2
fml8-8e49892e39d6dc1f9b41dd9cddd9a23a628b0e06.zip
change argv of FML::Credential::has_address_in_map():
($map, $address) -> ($map, $config, $address)
Diffstat (limited to 'fml/lib/FML/Command/UserControl.pm')
-rw-r--r--fml/lib/FML/Command/UserControl.pm28
1 files changed, 22 insertions, 6 deletions
diff --git a/fml/lib/FML/Command/UserControl.pm b/fml/lib/FML/Command/UserControl.pm
index 8eeef28d..b535c968 100644
--- a/fml/lib/FML/Command/UserControl.pm
+++ b/fml/lib/FML/Command/UserControl.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: UserControl.pm,v 1.13 2002/07/17 12:13:23 fukachan Exp $
+# $FML: UserControl.pm,v 1.14 2002/07/23 13:03:12 fukachan Exp $
#
package FML::Command::UserControl;
@@ -16,6 +16,8 @@ use FML::Credential;
use FML::Log qw(Log LogWarn LogError);
use IO::Adapter;
+my $debug = 0;
+
=head1 NAME
@@ -55,13 +57,16 @@ sub useradd
my $address = $uc_args->{ address };
my $maplist = $uc_args->{ maplist };
my $msg_args = $command_args->{ msg_args };
+ my $trycount = 0;
$msg_args->{ _arg_address } = $address;
for my $map (@$maplist) {
my $cred = new FML::Credential;
- unless ($cred->has_address_in_map($map, $address)) {
+ unless ($cred->has_address_in_map($map, $config, $address)) {
$msg_args->{ _arg_map } = $curproc->which_map_nl($map);
+ $trycount++;
+
my $obj = new IO::Adapter $map, $config;
$obj->touch(); # create a new map entry (e.g. file) if needed.
$obj->add( $address );
@@ -83,6 +88,10 @@ sub useradd
return undef;
}
}
+
+ unless ($trycount) {
+ LogError("no trail to add $address");
+ }
}
@@ -98,17 +107,20 @@ sub userdel
my $address = $uc_args->{ address };
my $maplist = $uc_args->{ maplist };
my $msg_args = $command_args->{ msg_args };
+ my $trycount = 0;
$msg_args->{ _arg_address } = $address;
for my $map (@$maplist) {
my $cred = new FML::Credential;
- if ($cred->has_address_in_map($map, $address)) {
+ if ($cred->has_address_in_map($map, $config, $address)) {
$msg_args->{ _arg_map } = $curproc->which_map_nl($map);
+
+ $trycount++;
- my $obj = new IO::Adapter $map, $config;
+ my $obj = new IO::Adapter $map, $config;
$obj->delete( $address );
unless ($obj->error()) {
- Log("removed $address from map=$map");
+ Log("remove $address from map=$map");
$curproc->reply_message_nl('command.del_ok',
"$address removed.",
$msg_args);
@@ -121,9 +133,13 @@ sub userdel
}
}
else {
- LogWarn("no such user in map=$map");
+ LogWarn("no such user in map=$map") if $debug;
}
}
+
+ unless ($trycount) {
+ LogError("no trail to remove $address");
+ }
}