version 1.78, 2019/05/05 23:19:47
|
version 1.79, 2019/08/25 02:42:56
|
Line 933 sub send_token {
|
Line 933 sub send_token {
|
# Check if the password entered by the user satisfies domain's requirements |
# Check if the password entered by the user satisfies domain's requirements |
my %passwdconf = &Apache::lonnet::get_passwdconf($domain); |
my %passwdconf = &Apache::lonnet::get_passwdconf($domain); |
my ($min,$max,@chars); |
my ($min,$max,@chars); |
|
$min = $Apache::lonnet::passwdmin; |
if (ref($passwdconf{'chars'}) eq 'ARRAY') { |
if (ref($passwdconf{'chars'}) eq 'ARRAY') { |
if ($passwdconf{'min'} =~ /^\d+$/) { |
if ($passwdconf{'min'} =~ /^\d+$/) { |
$min = $passwdconf{'min'}; |
if ($passwdconf{'min'} > $min) { |
|
$min = $passwdconf{'min'}; |
|
} |
} |
} |
if ($passwdconf{'max'} =~ /^\d+$/) { |
if ($passwdconf{'max'} =~ /^\d+$/) { |
$max = $passwdconf{'max'}; |
$max = $passwdconf{'max'}; |
} |
} |
@chars = @{$passwdconf{'chars'}}; |
@chars = @{$passwdconf{'chars'}}; |
} else { |
|
$min = 7; |
|
} |
} |
if (($min ne '') || ($max ne '') || (@chars > 0)) { |
my $encpass = $env{'form.upass'}; |
my ($plainpass,$encpass); |
if ($encpass eq '') { |
my $encpass = $env{'form.upass'}; |
$msg = &mt('Password retrieved was blank.'). |
if ($encpass eq '') { |
'<br /><p>'.&mt('[_1]Return[_2] to the previous page to try again.', |
$msg = &mt('Password retrieved was blank.'). |
'<a href="javascript:document.retryemail.submit();">','</a>'); |
'<br /><p>'.&mt('[_1]Return[_2] to the previous page to try again.', |
$earlyout = 1; |
'<a href="javascript:document.retryemail.submit();">','</a>'); |
} else { |
$earlyout = 1; |
|
} else { |
|
# Split the logtoken to retrieve the DES key and decrypt the encypted password |
# Split the logtoken to retrieve the DES key and decrypt the encypted password |
my ($key,$caller)=split(/&/,$tmpinfo); |
my ($key,$caller)=split(/&/,$tmpinfo); |
if ($caller eq 'createaccount') { |
if ($caller eq 'createaccount') { |
$plainpass = &Apache::loncommon::des_decrypt($key,$encpass); |
my $plainpass = &Apache::loncommon::des_decrypt($key,$encpass); |
|
if (($min > 0) || ($max ne '') || (@chars > 0)) { |
my $warning = &Apache::loncommon::check_passwd_rules($domain,$plainpass); |
my $warning = &Apache::loncommon::check_passwd_rules($domain,$plainpass); |
if ($warning) { |
if ($warning) { |
$msg = $warning. |
$msg = $warning. |