[LON-CAPA-cvs] cvs: modules /msu localenroll.pm

raeburn raeburn@source.lon-capa.org
Mon, 22 Feb 2010 21:18:15 -0000


raeburn		Mon Feb 22 21:18:15 2010 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  - &validate_instcode() returns an array.
    - when checking owners/co-owners for each section (to determine if
      access is allowed to classlist data for a specific course section)
      skip to next co-owner if co-owner is not in msu domain.
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.46 modules/msu/localenroll.pm:1.47
--- modules/msu/localenroll.pm:1.46	Sun Sep 13 14:35:57 2009
+++ modules/msu/localenroll.pm	Mon Feb 22 21:18:14 2010
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.46 2009/09/13 14:35:57 raeburn Exp $
+# $Id: localenroll.pm,v 1.47 2010/02/22 21:18:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -407,12 +407,12 @@
 sub validate_crsreq {
     my ($dom,$owner,$crstype,$inststatuslist,$instcode,$instseclist) = @_;
     my ($outcome,$message);
-    my $result = &validate_instcode($dom,$instcode,$owner);
+    my ($result,$description) = &validate_instcode($dom,$instcode,$owner);
     if ($result eq 'valid') {
         $outcome = 'process';
     } else {
         $outcome = 'pending';
-        $message = $result;
+        $message = $description;
     }
     return $outcome.':'.$message;
 }
@@ -613,9 +613,7 @@
         if ($person =~ /^([^:]+):([^:]+)$/) {
             $person = $1;
             my $ownerdom = $2;
-            if ($ownerdom ne $dom) {
-                return $sectioncheck;
-            }
+            next if ($ownerdom ne $dom);
         } elsif (defined($person) && $person ne '') {
             $person .= ':'.$dom;
         }