Diff for /loncom/interface/lonuserutils.pm between versions 1.202 and 1.208

version 1.202, 2019/08/25 02:42:56 version 1.208, 2021/08/23 20:10:40
Line 661  sub passwd_validation_js { Line 661  sub passwd_validation_js {
         if ($passwdconf{'min'} =~ /^\d+$/) {          if ($passwdconf{'min'} =~ /^\d+$/) {
             if ($passwdconf{'min'} > $min) {              if ($passwdconf{'min'} > $min) {
                 $min = $passwdconf{'min'};                  $min = $passwdconf{'min'};
                 $numrules ++;  
             }              }
         } else {  
             $numrules ++;  
         }          }
         if ($passwdconf{'max'} =~ /^\d+$/) {          if ($passwdconf{'max'} =~ /^\d+$/) {
             $max = $passwdconf{'max'};              $max = $passwdconf{'max'};
Line 674  sub passwd_validation_js { Line 671  sub passwd_validation_js {
         if (@chars) {          if (@chars) {
             $numrules ++;              $numrules ++;
         }          }
     } else {      }
       if ($min > 0) {
         $numrules ++;          $numrules ++;
     }      }
     if (($min > 0) || ($max ne '') || (@chars > 0)) {      if (($min > 0) || ($max ne '') || (@chars > 0)) {
Line 1711  sub my_custom_roles { Line 1709  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 3671  END Line 3670  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 5009  sub upfile_drop_add { Line 5010  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 5050  sub upfile_drop_add { Line 5061  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 5179  sub passwdrule_alerts { Line 5190  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.202  
changed lines
  Added in v.1.208


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