diff options
| author | fukachan <fukachan> | 2004-04-30 13:38:35 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-04-30 13:38:35 +0000 |
| commit | 516054253dffae26f3756ab9a47b5b4d39dcc5c4 (patch) | |
| tree | dcd6754c6a0d35f7ed5cb17ce9c41844f687c0b0 /fml/lib/FML/Command/Admin | |
| parent | 7d8c4dee4c08ce870b8e0240736ec2aef27e8f48 (diff) | |
| download | fml8-516054253dffae26f3756ab9a47b5b4d39dcc5c4.tar.gz fml8-516054253dffae26f3756ab9a47b5b4d39dcc5c4.tar.bz2 fml8-516054253dffae26f3756ab9a47b5b4d39dcc5c4.zip | |
more restrict error checks.
fix rewrite_prompt().
Diffstat (limited to 'fml/lib/FML/Command/Admin')
| -rw-r--r-- | fml/lib/FML/Command/Admin/changepassword.pm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fml/lib/FML/Command/Admin/changepassword.pm b/fml/lib/FML/Command/Admin/changepassword.pm index 8326b386..cea5baa6 100644 --- a/fml/lib/FML/Command/Admin/changepassword.pm +++ b/fml/lib/FML/Command/Admin/changepassword.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: changepassword.pm,v 1.12 2004/04/23 04:10:29 fukachan Exp $ +# $FML: changepassword.pm,v 1.13 2004/04/28 04:10:36 fukachan Exp $ # package FML::Command::Admin::changepassword; @@ -164,6 +164,7 @@ sub _change_password { my ($self, $curproc, $command_args, $address, $password) = @_; my $config = $curproc->config(); + my $cred = $curproc->{ credential }; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. @@ -180,6 +181,17 @@ sub _change_password }; my $r = ''; + my $member_map = $config->{ primary_admin_member_map }; + unless ($cred->has_address_in_map($member_map, $config, $address)) { + my $r = "no such admin member"; + my $r0 = "please add the address as an admin member."; + $curproc->reply_message_nl('error.no_such_admin_member', $r); + $curproc->reply_message_nl('command.please_add_admin_member', + $r0); + $curproc->logerror($r); + croak($r); + } + eval q{ use FML::Command::Auth; my $passwd = new FML::Command::Auth; @@ -200,7 +212,10 @@ sub rewrite_prompt my ($self, $curproc, $command_args, $rbuf) = @_; if (defined $rbuf) { - $$rbuf =~ s/^(.*(password|pass)\s+).*/$1 ********/; + $$rbuf =~ s/^(.*(password|pass)\s+\S+).*/$1 ********/; + unless ($$rbuf =~ /\*\*\*\*\*\*\*\*/o) { + $$rbuf =~ s/^(.*(password|pass)\s+).*/$1 ********/; + } } } |
