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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 29 Jun 2006 15:45:19 -0000


albertel		Thu Jun 29 11:45:19 2006 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - wasn't able to assign non-student roles
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.124 loncom/interface/loncreateuser.pm:1.125
--- loncom/interface/loncreateuser.pm:1.124	Wed Jun 28 14:18:44 2006
+++ loncom/interface/loncreateuser.pm	Thu Jun 29 11:45:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.124 2006/06/28 18:18:44 albertel Exp $
+# $Id: loncreateuser.pm,v 1.125 2006/06/29 15:45:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -415,15 +415,17 @@
                             sections = document.cu.elements[i+1].value;
                         }
                         var newsecs = document.cu.elements[i+1].value;
+			var numsplit;
                         if (newsecs != null && newsecs != "") {
-                            var numsplit = newsecs.split(/,/g);
+                            numsplit = newsecs.split(/,/g);
                             numsec = numsec + numsplit.length;
                         }
+
                         if ((role == 'st') && (numsec > 1)) {
                             alert("In each course, each user may only have one student role at a time. You had selected "+numsec+" sections.\\nPlease modify your selections so they include no more than one section.")
                             return;
                         }
-                        else {
+                        else if (numsplit != null) {
                             for (var j=0; j<numsplit.length; j++) {
                                 if ((numsplit[j] == 'all') ||
                                     (numsplit[j] == 'none')) {