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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 08 Jan 2004 03:38:08 -0000


raeburn		Wed Jan  7 22:38:08 2004 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  Check of course owner status in RO_CLIFMS employed in localenroll:new_course() now validates for regular faculty (Record_Type = 1) and TAs (Record_Type = 2).
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.4 modules/msu/localenroll.pm:1.5
--- modules/msu/localenroll.pm:1.4	Thu Dec 11 19:48:35 2003
+++ modules/msu/localenroll.pm	Wed Jan  7 22:38:08 2004
@@ -27,18 +27,16 @@
     my $DB_PATH;
     my $DB_USER = '';
     my $DB_PASSWD = '';
+    if (open (my $fh, "<$keydir/autoenroll.dat") ) {
+        ($DB_USER,$DB_PASSWD) = split/:/,<$fh>;
+        chomp($DB_PASSWD);
+        close($fh);
+    }
 
     if ($type eq 'RO') {
         $DB_PATH = "dbi:Sybase:server=ESDB1;database=RO_ClassList";
-        if (open (my $fh, "<$keydir/autoenroll.dat") ) {
-            ($DB_USER,$DB_PASSWD) = split/:/,<$fh>;
-            chomp($DB_PASSWD);
-            close($fh);
-        }
     } elsif ($type eq 'SIS') {
         $DB_PATH = "dbi:Sybase:server=msudata;database=SISInfo";
-        $DB_USER = ""; # Not in CVS
-        $DB_PASSWD = ""; # Not in CVS
     }
 
     my $dbh;
@@ -167,7 +165,7 @@
             my ($dbh,$dbflag) = &connect_DB($$configvars{'lonDaemons'},'RO');
             if ($dbflag) {
 # Check if instructor is in CLIFMS for this course
-                my $clifmscount = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$sem' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner' AND Record_Type='1'");
+                my $clifmscount = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$sem' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner' AND (Record_Type='1' OR Record_Type='2')");
                 if ($clifmscount > 0) {
 	       	    my $loncount = $dbh->selectrow_array("SELECT count(*) FROM LONCAPA WHERE Term_Code='$sem' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner'");
             	    if ($loncount == 0) {