summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2010-01-26 10:05:09 +0000
committerivan <ivan>2010-01-26 10:05:09 +0000
commit3ccbb380d0d3158874cd55b8e913dcc9ea2f7d76 (patch)
treee66dda4afe94aef6165d64db5de45a396d50f165 /FS
parent046395d0a66db2f057c80768e01ae0f5b06bc555 (diff)
more fallout from default pw encryption: fix error reporting when entering a bad password
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/svc_acct.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index ca33aa8..f965e8d 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -1333,11 +1333,14 @@ is >0), one will be generated randomly.
sub set_password {
my( $self, $pass ) = ( shift, shift );
+ warn "[$me] set_password (to $pass) called on $self: ". Dumper($self)
+ if $DEBUG;
+
my $failure = gettext('illegal_password'). " $passwordmin-$passwordmax ".
FS::Msgcat::_gettext('illegal_password_characters').
": ". $pass;
- my ($encoding, $encryption);
+ my( $encoding, $encryption ) = ('', '');
if ( $self->_password_encoding ) {
$encoding = $self->_password_encoding;
@@ -1357,7 +1360,7 @@ sub set_password {
$self->_password_encoding($encoding);
}
- if( $encoding eq 'legacy' ) {
+ if ( $encoding eq 'legacy' ) {
# The legacy behavior from check():
# If the password is blank, randomize it and set encoding to 'plain'.
@@ -1374,14 +1377,12 @@ sub set_password {
$pass = $1.$3;
$self->_password_encoding('crypt');
# Various disabled crypt passwords
- } elsif ( $pass eq '*' or
- $pass eq '!' or
- $pass eq '!!' ) {
+ } elsif ( $pass eq '*' || $pass eq '!' || $pass eq '!!' ) {
$self->_password_encoding('crypt');
} else {
return $failure;
}
- }
+ }
$self->_password($pass);
return;