version 1.1376, 2022/02/14 01:15:24
|
version 1.1377, 2022/02/16 16:28:49
|
Line 3649 sub check_passwd_rules {
|
Line 3649 sub check_passwd_rules {
|
} |
} |
|
|
sub passwd_validation_js { |
sub passwd_validation_js { |
my ($currpasswdval,$domain) = @_; |
my ($currpasswdval,$domain,$context,$id) = @_; |
my %passwdconf = &Apache::lonnet::get_passwdconf($domain); |
my (%passwdconf,$alertmsg); |
|
if ($context eq 'linkprot') { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['ltisec'],$domain); |
|
if (ref($domconfig{'ltisec'}) eq 'HASH') { |
|
if (ref($domconfig{'ltisec'}{'rules'}) eq 'HASH') { |
|
%passwdconf = %{$domconfig{'ltisec'}{'rules'}}; |
|
} |
|
} |
|
if ($id eq 'add') { |
|
$alertmsg = &mt('Secret for added launcher did not satisfy requirement(s):').'\n\n'; |
|
} elsif ($id =~ /^\d+$/) { |
|
my $pos = $id+1; |
|
$alertmsg = &mt('Secret for launcher [_1] did not satisfy requirement(s):','#'.$pos).'\n\n'; |
|
} else { |
|
$alertmsg = &mt('A secret did not satisfy requirement(s):').'\n\n'; |
|
} |
|
} else { |
|
%passwdconf = &Apache::lonnet::get_passwdconf($domain); |
|
$alertmsg = &mt('Initial password did not satisfy requirement(s):').'\n\n'; |
|
} |
my ($min,$max,@chars,$numrules,$intargjs,%alert); |
my ($min,$max,@chars,$numrules,$intargjs,%alert); |
$numrules = 0; |
$numrules = 0; |
$min = $Apache::lonnet::passwdmin; |
$min = $Apache::lonnet::passwdmin; |
Line 3673 sub passwd_validation_js {
|
Line 3692 sub passwd_validation_js {
|
$numrules ++; |
$numrules ++; |
} |
} |
if (($min > 0) || ($max ne '') || (@chars > 0)) { |
if (($min > 0) || ($max ne '') || (@chars > 0)) { |
my $alertmsg = &mt('Initial password did not satisfy requirement(s):').'\n\n'; |
|
if ($min) { |
if ($min) { |
$alert{'min'} = &mt('minimum [quant,_1,character]',$min).'\n'; |
$alert{'min'} = &mt('minimum [quant,_1,character]',$min).'\n'; |
} |
} |