--- loncom/interface/Attic/londropadd.pm 2003/09/29 16:09:20 1.86 +++ loncom/interface/Attic/londropadd.pm 2003/11/05 20:55:59 1.87 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.86 2003/09/29 16:09:20 www Exp $ +# $Id: londropadd.pm,v 1.87 2003/11/05 20:55:59 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -80,7 +80,7 @@ sub modifystudent { # We are in this course my $section=$1; $section='' if ($course eq $courseid.'_st'); - if ($section eq $csec) { + if (defined($csec) && $section eq $csec) { $result .= 'ok:'; } elsif ( ((!$section) && (!$csec)) || ($section ne $csec) ) { my (undef,$end,$start)=split(/\_/,$roles{$course}); @@ -755,7 +755,6 @@ sub print_enroll_single_student_form { if ($home ne 'no_host') { $new_user = 0; } - &Apache::lonnet::logthis('home = '.$home); # my $user_data_html = ''; my $javascript_validations = ''; @@ -1150,6 +1149,11 @@ sub print_modify_student_form { } # determine the students starting and ending times and section my ($starttime,$endtime,$section) = &get_enrollment_data($sname,$sdom); + if ($starttime =~ /^error/) { + $r->print('

Error

'); + $r->print('

'.$starttime.'

'); + return; + } # Deal with date forms my $date_table = &date_setting_table($starttime,$endtime); # @@ -1349,7 +1353,7 @@ sub get_enrollment_data { my %roles = &Apache::lonnet::dump('roles',$sdomain,$sname); my ($tmp) = keys(%roles); # Bail out if we were unable to get the students roles - return "666" if ($tmp =~ /^(con_lost|error|no_such_host)/i); + return ('error'.$tmp) if ($tmp =~ /^(con_lost|error|no_such_host)/i); # Go through the roles looking for enrollment in this course my ($end,$start) = (undef,undef); my $section = '';