--- loncom/interface/loncommon.pm 2024/08/22 17:05:49 1.1075.2.161.2.26 +++ loncom/interface/loncommon.pm 2024/09/03 09:20:42 1.1075.2.161.2.27 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.161.2.26 2024/08/22 17:05:49 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.161.2.27 2024/09/03 09:20:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3452,6 +3452,21 @@ sub passwd_validation_js { } else { $alertmsg = &mt('A secret did not satisfy requirement(s):').'\n\n'; } + } elsif ($context eq 'ltitools') { + my %domconfig = &Apache::lonnet::get_dom('configuration',['toolsec'],$domain); + if (ref($domconfig{'toolsec'}) eq 'HASH') { + if (ref($domconfig{'toolsec'}{'rules'}) eq 'HASH') { + %passwdconf = %{$domconfig{'toolsec'}{'rules'}}; + } + } + if ($id eq 'add') { + $alertmsg = &mt('Secret for added external tool did not satisfy requirement(s):').'\n\n'; + } elsif ($id =~ /^\d+$/) { + my $pos = $id+1; + $alertmsg = &mt('Secret for external tool [_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';