--- loncom/interface/createaccount.pm 2019/05/05 23:19:47 1.78
+++ loncom/interface/createaccount.pm 2019/08/25 02:42:56 1.79
@@ -4,7 +4,7 @@
# kerberos, or SSO) or an e-mail address. Requests to use an e-mail address as
# username may be processed automatically, or may be queued for approval.
#
-# $Id: createaccount.pm,v 1.78 2019/05/05 23:19:47 raeburn Exp $
+# $Id: createaccount.pm,v 1.79 2019/08/25 02:42:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -933,30 +933,30 @@ sub send_token {
# Check if the password entered by the user satisfies domain's requirements
my %passwdconf = &Apache::lonnet::get_passwdconf($domain);
my ($min,$max,@chars);
+ $min = $Apache::lonnet::passwdmin;
if (ref($passwdconf{'chars'}) eq 'ARRAY') {
if ($passwdconf{'min'} =~ /^\d+$/) {
- $min = $passwdconf{'min'};
+ if ($passwdconf{'min'} > $min) {
+ $min = $passwdconf{'min'};
+ }
}
if ($passwdconf{'max'} =~ /^\d+$/) {
$max = $passwdconf{'max'};
}
@chars = @{$passwdconf{'chars'}};
- } else {
- $min = 7;
}
- if (($min ne '') || ($max ne '') || (@chars > 0)) {
- my ($plainpass,$encpass);
- my $encpass = $env{'form.upass'};
- if ($encpass eq '') {
- $msg = &mt('Password retrieved was blank.').
- '
'.&mt('[_1]Return[_2] to the previous page to try again.',
- '','');
- $earlyout = 1;
- } else {
+ my $encpass = $env{'form.upass'};
+ if ($encpass eq '') {
+ $msg = &mt('Password retrieved was blank.').
+ '
'.&mt('[_1]Return[_2] to the previous page to try again.', + '',''); + $earlyout = 1; + } else { # Split the logtoken to retrieve the DES key and decrypt the encypted password - my ($key,$caller)=split(/&/,$tmpinfo); - if ($caller eq 'createaccount') { - $plainpass = &Apache::loncommon::des_decrypt($key,$encpass); + my ($key,$caller)=split(/&/,$tmpinfo); + if ($caller eq 'createaccount') { + my $plainpass = &Apache::loncommon::des_decrypt($key,$encpass); + if (($min > 0) || ($max ne '') || (@chars > 0)) { my $warning = &Apache::loncommon::check_passwd_rules($domain,$plainpass); if ($warning) { $msg = $warning.