--- loncom/interface/Attic/londropadd.pm 2002/04/26 19:10:54 1.32 +++ loncom/interface/Attic/londropadd.pm 2002/04/29 14:36:23 1.33 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.32 2002/04/26 19:10:54 matthew Exp $ +# $Id: londropadd.pm,v 1.33 2002/04/29 14:36:23 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,7 +75,7 @@ ENDHEAD # =========== Drop student from all sections of a course, except optional $csec sub modifystudent { - my ($udom,$unam,$courseid,$csec)=@_; + my ($udom,$unam,$courseid,$csec,$desiredhost)=@_; # if $csec is undefined, drop the student from all the courses matching # this one. If $csec is defined, drop them from all other sections of # this course and add them to section $csec @@ -97,7 +97,8 @@ sub modifystudent { my $now=time; if (!($start && ($now<$start)) || !($end && ($now>$end))) { my $reply=&Apache::lonnet::modifystudent - ($udom,$unam,'','','','','','','',$section,time); + ($udom,$unam,'','','','','','','', + $section,time,undef,undef,$desiredhost); } } } @@ -534,6 +535,9 @@ sub enroll_single_student { if (!$genpwd) { $genpwd=" "; } } if (($amode) && ($genpwd)) { + &modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, + $ENV{'request.course.id'},$ENV{'form.csec'}, + $desiredhost); $r->print(&Apache::lonnet::modifystudent( $ENV{'form.lcdomain'},$ENV{'form.cuname'}, $ENV{'form.cstid'},$amode,$genpwd, @@ -542,8 +546,6 @@ sub enroll_single_student { $ENV{'form.csec'},$ENV{'form.enddate'}, $ENV{'form.startdate'},$ENV{'form.forceid'}, $desiredhost)); - &modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, - $ENV{'request.course.id'},$ENV{'form.csec'}); } else { $r->print('Invalid login mode or password'); } @@ -871,11 +873,12 @@ sub upfile_drop_add { } } if ($password) { + &modifystudent($domain,$username,$cid,$sec, + $desiredhost); my $reply=&Apache::lonnet::modifystudent ($domain,$username,$id,$amode,$password, $fname,$mname,$lname,$gen,$sec,$enddate, $startdate,$ENV{'form.forceid'},$desiredhost); - &modifystudent($domain,$username,$cid,$sec); if ($reply ne 'ok') { $r->print('

'. 'Error enrolling '.$username.': '.