[LON-CAPA-cvs] cvs: loncom /html/adm/helper course.initialization.helper

albertel lon-capa-cvs-allow@mail.lon-capa.org
Mon, 29 Oct 2007 19:26:49 -0000


albertel		Mon Oct 29 15:26:49 2007 EDT

  Modified files:              
    /loncom/html/adm/helper	course.initialization.helper 
  Log:
  - BUG#5498 - allow a blank as a valid list of cloners
  
  
Index: loncom/html/adm/helper/course.initialization.helper
diff -u loncom/html/adm/helper/course.initialization.helper:1.20 loncom/html/adm/helper/course.initialization.helper:1.21
--- loncom/html/adm/helper/course.initialization.helper:1.20	Wed Sep  5 08:46:21 2007
+++ loncom/html/adm/helper/course.initialization.helper	Mon Oct 29 15:26:48 2007
@@ -252,26 +252,27 @@
           $cloners[0] = $val;
       }
       foreach my $item (@cloners) {
-          if ($item ne '*') {
-              my ($clname,$cldom) = split(/:/,$item);
-              if ($clname eq '*') {
-                  if ($cldom =~ /^$match_dom$/) {
-                      if (!&Apache::lonnet::domain($cldom)) {
-                          $disallowed{'domain'} .= $item.',';
-                      }
-                  } else {
-                      $disallowed{'format'} .= $item.',';
-                  }
-              } elsif ($item !~/^($match_uname)\:($match_dom)$/) {
-                  $disallowed{'format'} .= $item.',';
-              } else {
-                  if (!&Apache::lonnet::domain($cldom)) {
-                      $disallowed{'domain'} .= $item.','; 
-                  } elsif (&Apache::lonnet::homeserver($clname,$cldom) eq 'no_host') {
-                      $disallowed{'newuser'} .= $item.',';
-                  }
-              }
-          }
+	  next if ($item =~ /^\s*$/);
+	  next if ($item eq '*');
+       
+	  my ($clname,$cldom) = split(/:/,$item);
+	  if ($clname eq '*') {
+	      if ($cldom =~ /^$match_dom$/) {
+		  if (!&Apache::lonnet::domain($cldom)) {
+		      $disallowed{'domain'} .= $item.',';
+		  }
+	      } else {
+		  $disallowed{'format'} .= $item.',';
+	      }
+	  } elsif ($item !~/^($match_uname)\:($match_dom)$/) {
+	      $disallowed{'format'} .= $item.',';
+	  } else {
+	      if (!&Apache::lonnet::domain($cldom)) {
+		  $disallowed{'domain'} .= $item.','; 
+	      } elsif (&Apache::lonnet::homeserver($clname,$cldom) eq 'no_host') {
+		  $disallowed{'newuser'} .= $item.',';
+	      }
+	  }
       }
       foreach my $key (keys(%disallowed)) {
           $disallowed{$key} =~ s/,$//;
@@ -290,7 +291,7 @@
               $output .= '<li>LON-CAPA user(s) do(es) not exist: '.
                          '<b>'.$disallowed{'newuser'}.'</b></li>';
           }
-          $output .= '.</ul>';
+          $output .= '</ul>';
       }
       return $output;
     </validator>