Diff for /loncom/enrollment/Enrollment.pm between versions 1.45 and 1.47

version 1.45, 2013/07/24 18:21:49 version 1.47, 2014/06/23 00:56:02
Line 61  sub update_LC { Line 61  sub update_LC {
     my @activestudents = ();      my @activestudents = ();
     my @excludedstudents = ();      my @excludedstudents = ();
     my $currlist;      my $currlist;
       my $now = time;
     foreach my $uname (keys %{$roster} ) {      foreach my $uname (keys %{$roster} ) {
         if ($uname =~ m/^(.+):$dom$/) {          if ($uname =~ m/^(.+):$dom$/) {
             if ($$roster{$uname}[$status] eq "Active") {              if ($$roster{$uname}[$status] eq "Active") {
Line 229  sub update_LC { Line 230  sub update_LC {
                     my $drop_reply = &Apache::lonnet::modifystudent($dom,$uname,'','','',undef,undef,undef,undef,$$currlist{$uname}[$sec],time,undef,undef,undef,undef,'auto','',$cid,'',$context);                      my $drop_reply = &Apache::lonnet::modifystudent($dom,$uname,'','','',undef,undef,undef,undef,$$currlist{$uname}[$sec],time,undef,undef,undef,undef,'auto','',$cid,'',$context);
 # re-enroll as auto student  # re-enroll as auto student
                     if ($drop_reply !~ /^ok/) {                      if ($drop_reply !~ /^ok/) {
                             $$logmsg .= &mt('An error occured during the attempt to convert [_1] from a manual type to an auto type student - [_2].',$uname,$drop_reply).$linefeed;                              $$logmsg .= &mt('An error occurred during the attempt to convert [_1] from a manual type to an auto type student - [_2].',$uname,$drop_reply).$linefeed;
                     } else {                      } else {
 # re-enroll as auto student  # re-enroll as auto student
                         my ($auth,$authparam,$first,$middle,$last,$gene,$usec,$end,$start,$emailaddr,$pid,$emailenc);                          my ($auth,$authparam,$first,$middle,$last,$gene,$usec,$end,$start,$emailaddr,$pid,$emailenc);
Line 339  sub update_LC { Line 340  sub update_LC {
                     my ($auth,$authparam,$first,$middle,$last,$gene,$usec,$end,$start,$emailaddr,$pid,$emailenc,$credithours);                      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);                      &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  # Check for existing account in this LON-CAPA domain for this username
                       next if (($end) && ($end < $now));
                     my $uhome=&Apache::lonnet::homeserver($uname,$dom);                      my $uhome=&Apache::lonnet::homeserver($uname,$dom);
                     if ($uhome eq 'no_host') { # User does not exist                      if ($uhome eq 'no_host') { # User does not exist
                         my $args = {'auth' => $auth,                          my $args = {'auth' => $auth,
Line 429  sub update_LC { Line 431  sub update_LC {
                     } elsif (@saved == 0) {                      } elsif (@saved == 0) {
                         my $drop_reply = &Apache::lonnet::modifystudent($dom,$uname,'','','',undef,undef,undef,undef,$$currlist{$uname}[$sec],time,undef,undef,undef,undef,'auto','',$cid,'',$context);                          my $drop_reply = &Apache::lonnet::modifystudent($dom,$uname,'','','',undef,undef,undef,undef,$$currlist{$uname}[$sec],time,undef,undef,undef,undef,'auto','',$cid,'',$context);
                         if ($drop_reply !~ /^ok/) {                          if ($drop_reply !~ /^ok/) {
                             $$logmsg .= &mt('An error occured during the attempt to expire the [_1] from the old section [_2] - [_3].',$uname,$$currlist{$uname}[$sec],$drop_reply).$linefeed;                              $$logmsg .= &mt('An error occurred during the attempt to expire the [_1] from the old section [_2] - [_3].',$uname,$$currlist{$uname}[$sec],$drop_reply).$linefeed;
                         } else {                          } else {
                             $dropcount ++;                              $dropcount ++;
                             my %userenv = &Apache::lonnet::get('environment',['firstname','lastname','id'],$dom,$uname);                              my %userenv = &Apache::lonnet::get('environment',['firstname','lastname','id'],$dom,$uname);
Line 651  sub prepare_add { Line 653  sub prepare_add {
     $$start = $$stuinfo[ $$place{'startdate'} ];      $$start = $$stuinfo[ $$place{'startdate'} ];
     $$emailaddr = $$stuinfo[ $$place{'email'} ];      $$emailaddr = $$stuinfo[ $$place{'email'} ];
     $$pid = $$stuinfo[ $$place{'studentID'} ];      $$pid = $$stuinfo[ $$place{'studentID'} ];
                                                                                     
 # remove non alphanumeric values from section  # remove non alphanumeric values from section
     $$usec =~ s/\W//g;      $$usec =~ s/\W//g;
                                                                                                                                                                       

Removed from v.1.45  
changed lines
  Added in v.1.47


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>