[LON-CAPA-cvs] cvs: loncom /enrollment Enrollment.pm

raeburn raeburn at source.lon-capa.org
Sun Jun 22 20:56:02 EDT 2014


raeburn		Mon Jun 23 00:56:02 2014 EDT

  Modified files:              
    /loncom/enrollment	Enrollment.pm 
  Log:
  - Bug 6390.
    - Auto-enroll should not enroll if access end date is in the past.
  
  
Index: loncom/enrollment/Enrollment.pm
diff -u loncom/enrollment/Enrollment.pm:1.46 loncom/enrollment/Enrollment.pm:1.47
--- loncom/enrollment/Enrollment.pm:1.46	Wed Aug 14 00:38:50 2013
+++ loncom/enrollment/Enrollment.pm	Mon Jun 23 00:56:02 2014
@@ -1,5 +1,5 @@
 # Automated Enrollment manager
-# $Id: Enrollment.pm,v 1.46 2013/08/14 00:38:50 raeburn Exp $
+# $Id: Enrollment.pm,v 1.47 2014/06/23 00:56:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,6 +61,7 @@
     my @activestudents = ();
     my @excludedstudents = ();
     my $currlist;
+    my $now = time;
     foreach my $uname (keys %{$roster} ) {
         if ($uname =~ m/^(.+):$dom$/) {
             if ($$roster{$uname}[$status] eq "Active") {
@@ -339,6 +340,7 @@
                     my ($auth,$authparam,$first,$middle,$last,$gene,$usec,$end,$start,$emailaddr,$pid,$emailenc,$credithours);
                     &prepare_add($authtype,$autharg,$enddate,$startdate,\@stuinfo,\%place,\$dom,\$uname,\$auth,\$authparam,\$first,\$middle,\$last,\$gene,\$usec,\$end,\$start,\$emailaddr,\$pid,\$emailenc);
 # Check for existing account in this LON-CAPA domain for this username
+                    next if (($end) && ($end < $now));
                     my $uhome=&Apache::lonnet::homeserver($uname,$dom);
                     if ($uhome eq 'no_host') { # User does not exist
                         my $args = {'auth' => $auth,
@@ -651,7 +653,7 @@
     $$start = $$stuinfo[ $$place{'startdate'} ];
     $$emailaddr = $$stuinfo[ $$place{'email'} ];
     $$pid = $$stuinfo[ $$place{'studentID'} ];
-                                                                                  
+
 # remove non alphanumeric values from section
     $$usec =~ s/\W//g;
                                                                                   




More information about the LON-CAPA-cvs mailing list