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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sun, 29 Jul 2007 15:22:24 -0000


raeburn		Sun Jul 29 11:22:24 2007 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  Fix some typos.
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.27 modules/msu/localenroll.pm:1.28
--- modules/msu/localenroll.pm:1.27	Wed Jul 25 19:03:15 2007
+++ modules/msu/localenroll.pm	Sun Jul 29 11:22:24 2007
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.27 2007/07/25 23:03:15 raeburn Exp $
+# $Id: localenroll.pm,v 1.28 2007/07/29 15:22:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -454,7 +454,7 @@
                     $sectioncheck = 'ok';
                 }
             } elsif ($sectioncheck > 0) {
-                $sectioncheck eq 'ok';
+                $sectioncheck = 'ok';
             }
         }
     }
@@ -515,14 +515,14 @@
         }
         if ($srchby eq '' && $srchterm eq '') {
             if ($uname ne '') {
-                $searchby = 'uname';
-                $searchterm = $uname;
+                $srchby = 'uname';
+                $srchterm = $uname;
             } elsif ($id ne '') {
-                $searchby = 'id';
-                $searchterm = $id;
+                $srchby = 'id';
+                $srchterm = $id;
             }
         }
-        if ($searchterm ne '') {
+        if ($srchterm ne '') {
             &query_user_tables($dbh,\@srchtables,$instusers,$instids,
                                $srchby,$srchterm,$srchtype);
             $outcome = 'ok';
@@ -538,7 +538,7 @@
     if ($srchby eq 'uname') {
         if ($srchterm =~ /^\w{2,8}$/) {
             if ($srchtype eq 'contains') {
-                $condition = "WHERE MSUNetID LIKE '%$srchterm%';
+                $condition = "WHERE MSUNetID LIKE '%$srchterm%'";
             } else {
                 $condition = "WHERE MSUNetID = '$srchterm'";
             }
@@ -547,9 +547,9 @@
         if ($srchterm =~ /[A-Za-z\-\.']+/) {
             if ($srchtype eq 'contains') {
                 my $quoted_last = $dbh->quote('%'.$srchterm.'%');
-                $condition = "WHERE LastName LIKE $quotedlast";
+                $condition = "WHERE LastName LIKE $quoted_last";
             } else {
-                my $quotedlast = $dbh->quote($srchterm);
+                my $quoted_last = $dbh->quote($srchterm);
                 $condition = "WHERE LastName = $quoted_last";
             }
         }
@@ -563,8 +563,8 @@
                 $condition = "WHERE LastName LIKE $quoted_last AND
                                     FirstName LIKE $quoted_first";
             } else {
-                my $quotedlast = $dbh->quote($srchterm);
-                my $quotedfirst = $dbh->quote($srchterm);
+                my $quoted_last = $dbh->quote($srchterm);
+                my $quoted_first = $dbh->quote($srchterm);
                 $condition = "WHERE LastName = $quoted_last AND
                                     FirstName = $quoted_first";
             }
@@ -575,7 +575,8 @@
         }
     }
     foreach my $table (@{$srchtables}) {
-        my $sth = $dbh->prepare("SELECT MSUNetID,Pid,FirstName,LastName,Person_Type FROM $table $condition");
+        my $statement = "SELECT MSUNetID,Pid,FirstName,LastName,Person_Type FROM $table $condition";
+        my $sth = $dbh->prepare("$statement");
         $sth->execute();
         while ( my($uname,$pid,$first,$last,$type) = $sth->fetchrow_array ) {
             $pid=lc($pid);