use Authen::Passphrase::BlowfishCrypt;
# https://rt.cpan.org/Ticket/Display.html?id=72743
-our $DEBUG = 1;
-our $conf;
-FS::UID->install_callback( sub {
- $conf = FS::Conf->new;
- # this is safe
- #eval "use Authen::Passphrase::BlowfishCrypt;";
-});
+our $DEBUG = 0;
our $me = '[' . __PACKAGE__ . ']';
# check length and complexity here
- if ( $conf->config('password-no_reuse') =~ /^(\d+)$/ ) {
+ my $no_reuse = 3;
+ # allow override here if we really must
- my $no_reuse = $1;
+ if ( $no_reuse > 0 ) {
# "the last N" passwords includes the current password and the N-1
# passwords before that.
$auth = $self->_blowfishcrypt( $auth->passphrase );
}
- } elsif ( $encoding eq 'plain' ) {
+ } else {
+ warn "unrecognized password encoding '$encoding'; treating as plain text"
+ unless $encoding eq 'plain';
$auth = $self->_blowfishcrypt( $password );