[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Fri Feb 7 15:42:50 EST 2020


raeburn		Fri Feb  7 20:42:50 2020 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - Configuring internally authenticated passwords.
   - Fix logic in: warnIntPass() so max length and number to save cab be set.
   - Display requirements for characters when changes made to domain config.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.369 loncom/interface/domainprefs.pm:1.370
--- loncom/interface/domainprefs.pm:1.369	Wed Feb  5 23:46:01 2020
+++ loncom/interface/domainprefs.pm	Fri Feb  7 20:42:50 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.369 2020/02/05 23:46:01 raeburn Exp $
+# $Id: domainprefs.pm,v 1.370 2020/02/07 20:42:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9378,8 +9378,8 @@
                             alert('$intalert{passnum}');
                         }
                     }
+                    field.value = '';
                 }
-                field.value = '';
             }
         }
     }
@@ -14763,6 +14763,8 @@
                 if ($staticdefaults{$rule} ne $newvalues{$rule}) {
                     $changes{'rules'} = 1;
                 }
+            } else {
+                $changes{'rules'} = 1;
             }
         } elsif (exists($current{$rule})) {
             $changes{'rules'} = 1;
@@ -14972,6 +14974,24 @@
                                 $resulttext .= '<li>'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'</li>';
                             }
                         }
+                        if (ref($confighash{'passwords'}{'chars'}) eq 'ARRAY') {
+                            if (@{$confighash{'passwords'}{'chars'}} > 0) {
+                                my %rulenames = &Apache::lonlocal::texthash(
+                                                     uc => 'At least one upper case letter',
+                                                     lc => 'At least one lower case letter',
+                                                     num => 'At least one number',
+                                                     spec => 'At least one non-alphanumeric',
+                                                   );
+                                my $needed = '<ul><li>'.
+                                             join('</li><li>',map {$rulenames{$_} } @{$confighash{'passwords'}{'chars'}}).
+                                             '</li></ul>'; 
+                                $resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{'chars'},$needed).'</li>';
+                            } else {
+                                $resulttext .= '<li>'.&mt('[_1] set to none',$titles{'chars'}).'</li>';
+                            }
+                        } else {
+                            $resulttext .= '<li>'.&mt('[_1] set to none',$titles{'chars'}).'</li>';
+                        }
                     } elsif ($key eq 'crsownerchg') {
                         if (ref($confighash{'passwords'}{'crsownerchg'}) eq 'HASH') {
                             if ((@{$confighash{'passwords'}{'crsownerchg'}{'by'}} == 0) ||




More information about the LON-CAPA-cvs mailing list