--- loncom/interface/lonuserutils.pm	2019/08/25 02:42:56	1.202
+++ loncom/interface/lonuserutils.pm	2020/02/10 17:12:54	1.205
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.202 2019/08/25 02:42:56 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.205 2020/02/10 17:12:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -661,10 +661,7 @@ sub passwd_validation_js {
         if ($passwdconf{'min'} =~ /^\d+$/) {
             if ($passwdconf{'min'} > $min) {
                 $min = $passwdconf{'min'};
-                $numrules ++;
             }
-        } else {
-            $numrules ++;
         }
         if ($passwdconf{'max'} =~ /^\d+$/) {
             $max = $passwdconf{'max'};
@@ -674,7 +671,8 @@ sub passwd_validation_js {
         if (@chars) {
             $numrules ++;
         }
-    } else {
+    }
+    if ($min > 0) {
         $numrules ++;
     }
     if (($min > 0) || ($max ne '') || (@chars > 0)) {
@@ -3671,6 +3669,8 @@ END
         setSections(formname,'$crstype');
         if (seccheck == 'ok') {
             opener.document.$callingform.newsecs.value = formname.sections.value;
+        } else {
+            return;
         }
 END
     } else {
@@ -5050,16 +5050,16 @@ sub upfile_drop_add {
                                     }
                                 }
                             }
-                            if (!$multiple) {
-                                ($userresult,$authresult,$roleresult,$idresult) = 
-                                    &modifyuserrole($context,$setting,
-                                                    $changeauth,$cid,$userdomain,$username, 
-                                                    $id,$amode,$password,$fname,
-                                                    $mname,$lname,$gen,$singlesec,
-                                                    $env{'form.forceid'},$desiredhost,
-                                                    $email,$role,$enddate,$startdate,
-                                                    $checkid,$inststatus);
-                            }
+                        }
+                        if (!$multiple) {
+                            ($userresult,$authresult,$roleresult,$idresult) = 
+                                &modifyuserrole($context,$setting,
+                                                $changeauth,$cid,$userdomain,$username, 
+                                                $id,$amode,$password,$fname,
+                                                $mname,$lname,$gen,$singlesec,
+                                                $env{'form.forceid'},$desiredhost,
+                                                $email,$role,$enddate,$startdate,
+                                                $checkid,$inststatus);
                         }
                     }
                     if ($multiple) {