Diff for /loncom/interface/lonuserutils.pm between versions 1.201 and 1.209

version 1.201, 2019/07/23 13:58:53 version 1.209, 2021/08/24 00:15:02
Line 543  END Line 543  END
             case 'krb':              case 'krb':
                 alertmsg = '$alert{'krb'}';                  alertmsg = '$alert{'krb'}';
                 break;                  break;
             case 'loc':  
             case 'int':              case 'int':
                 alertmsg = '$alert{'ipass'}';                  alertmsg = '$alert{'ipass'}';
                 break;                  break;
             case 'fsys':              case 'fsys':
                 alertmsg = '$alert{'ipass'}';                  alertmsg = '$alert{'ipass'}';
                 break;                  break;
               case 'loc':
                   alertmsg = '';
                   break;
             case 'lti':              case 'lti':
             default:              default:
                 alertmsg = '';                  alertmsg = '';
Line 656  sub passwd_validation_js { Line 658  sub passwd_validation_js {
     my %passwdconf = &Apache::lonnet::get_passwdconf($domain);      my %passwdconf = &Apache::lonnet::get_passwdconf($domain);
     my ($min,$max,@chars,$numrules,$intargjs,%alert);      my ($min,$max,@chars,$numrules,$intargjs,%alert);
     $numrules = 0;      $numrules = 0;
       $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) {
             $numrules ++;                  $min = $passwdconf{'min'};
               }
         }          }
         if ($passwdconf{'max'} =~ /^\d+$/) {          if ($passwdconf{'max'} =~ /^\d+$/) {
             $max = $passwdconf{'max'};              $max = $passwdconf{'max'};
Line 669  sub passwd_validation_js { Line 673  sub passwd_validation_js {
         if (@chars) {          if (@chars) {
             $numrules ++;              $numrules ++;
         }          }
     } else {      }
         $min = 7;      if ($min > 0) {
         $numrules ++;          $numrules ++;
     }      }
     if (($min ne '') || ($max ne '') || (@chars > 0)) {      if (($min > 0) || ($max ne '') || (@chars > 0)) {
         my $alertmsg = &mt('Initial password did not satisfy requirement(s):').'\n\n';          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';
Line 1707  sub my_custom_roles { Line 1711  sub my_custom_roles {
     my %rolehash=&Apache::lonnet::dump('roles',$udom,$uname);      my %rolehash=&Apache::lonnet::dump('roles',$udom,$uname);
     foreach my $key (keys(%rolehash)) {      foreach my $key (keys(%rolehash)) {
         if ($key=~/^rolesdef\_(\w+)$/) {          if ($key=~/^rolesdef\_(\w+)$/) {
               my $role = $1;
             if ($crstype eq 'Community') {              if ($crstype eq 'Community') {
                 next if ($rolehash{$key} =~ /bre\&S/);                   next if ($rolehash{$key} =~ /bre\&S/); 
             }              }
             $returnhash{$1}=$1;              $returnhash{$role}=$role;
         }          }
     }      }
     return %returnhash;      return %returnhash;
Line 3667  END Line 3672  END
         setSections(formname,'$crstype');          setSections(formname,'$crstype');
         if (seccheck == 'ok') {          if (seccheck == 'ok') {
             opener.document.$callingform.newsecs.value = formname.sections.value;              opener.document.$callingform.newsecs.value = formname.sections.value;
           } else {
               return;
         }          }
 END  END
     } else {      } else {
Line 4387  sub upfile_drop_add { Line 4394  sub upfile_drop_add {
         if ((defined($env{'form.intarg'})) && ($env{'form.intarg'})) {          if ((defined($env{'form.intarg'})) && ($env{'form.intarg'})) {
             $genpwd=$env{'form.intarg'};              $genpwd=$env{'form.intarg'};
             @genpwdfail =              @genpwdfail =
                 &Apache::loncommon::check_passwd_rules($domain,$genpwd);                   &Apache::loncommon::check_passwd_rules($domain,$genpwd);
         }          }
     } elsif ($env{'form.login'} eq 'loc') {      } elsif ($env{'form.login'} eq 'loc') {
         $amode='localauth';          $amode='localauth';
Line 5005  sub upfile_drop_add { Line 5012  sub upfile_drop_add {
                     my (%userres,%authres,%roleres,%idres);                      my (%userres,%authres,%roleres,%idres);
                     my $singlesec = '';                      my $singlesec = '';
                     if ($role eq 'st') {                      if ($role eq 'st') {
                           if (($context eq 'domain') && ($changeauth eq 'Yes') && (!$newuser)) {
                               if ((&Apache::lonnet::allowed('mau',$userdomain)) &&
                                   (&Apache::lonnet::homeserver($username,$userdomain) ne 'no_host')) {
                                   if ((($amode =~ /^krb4|krb5|internal$/) && $password ne '') ||
                                        ($amode eq 'localauth')) {
                                       $authresult =
                                           &Apache::lonnet::modifyuserauth($userdomain,$username,$amode,$password);
                                   }
                               }
                           }
                         my $sec;                          my $sec;
                         if (ref($userinfo{$i}{'sections'}) eq 'ARRAY') {                          if (ref($userinfo{$i}{'sections'}) eq 'ARRAY') {
                             if (@secs > 0) {                              if (@secs > 0) {
Line 5046  sub upfile_drop_add { Line 5063  sub upfile_drop_add {
                                     }                                      }
                                 }                                  }
                             }                              }
                             if (!$multiple) {                          }
                                 ($userresult,$authresult,$roleresult,$idresult) =                           if (!$multiple) {
                                     &modifyuserrole($context,$setting,                              ($userresult,$authresult,$roleresult,$idresult) = 
                                                     $changeauth,$cid,$userdomain,$username,                                   &modifyuserrole($context,$setting,
                                                     $id,$amode,$password,$fname,                                                  $changeauth,$cid,$userdomain,$username, 
                                                     $mname,$lname,$gen,$singlesec,                                                  $id,$amode,$password,$fname,
                                                     $env{'form.forceid'},$desiredhost,                                                  $mname,$lname,$gen,$singlesec,
                                                     $email,$role,$enddate,$startdate,                                                  $env{'form.forceid'},$desiredhost,
                                                     $checkid,$inststatus);                                                  $email,$role,$enddate,$startdate,
                             }                                                  $checkid,$inststatus);
                         }                          }
                     }                      }
                     if ($multiple) {                      if ($multiple) {
Line 5175  sub passwdrule_alerts { Line 5192  sub passwdrule_alerts {
             my %passwdconf = &Apache::lonnet::get_passwdconf($domain);              my %passwdconf = &Apache::lonnet::get_passwdconf($domain);
             $warning = '<b>'.&mt('Password requirement(s) unmet for one or more users:').'</b><ul>';              $warning = '<b>'.&mt('Password requirement(s) unmet for one or more users:').'</b><ul>';
             if ($showrules{'min'}) {              if ($showrules{'min'}) {
                 $warning .= '<li>'.&mt('minimum [quant,_1,character]',$passwdconf{'min'}).'</li>';                  my $min = $passwdconf{'min'};
                   if ($min eq '') {
                       $min = $Apache::lonnet::passwdmin;
                   }
                   $warning .= '<li>'.&mt('minimum [quant,_1,character]',$min).'</li>';
             }              }
             if ($showrules{'max'}) {              if ($showrules{'max'}) {
                 $warning .= '<li>'.&mt('maximum [quant,_1,character]',$passwdconf{'max'}).'</li>';                  $warning .= '<li>'.&mt('maximum [quant,_1,character]',$passwdconf{'max'}).'</li>';

Removed from v.1.201  
changed lines
  Added in v.1.209


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>