version 1.32, 2002/04/26 19:10:54
|
version 1.33, 2002/04/29 14:36:23
|
Line 75 ENDHEAD
|
Line 75 ENDHEAD
|
|
|
# =========== Drop student from all sections of a course, except optional $csec |
# =========== Drop student from all sections of a course, except optional $csec |
sub modifystudent { |
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 |
# 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 one. If $csec is defined, drop them from all other sections of |
# this course and add them to section $csec |
# this course and add them to section $csec |
Line 97 sub modifystudent {
|
Line 97 sub modifystudent {
|
my $now=time; |
my $now=time; |
if (!($start && ($now<$start)) || !($end && ($now>$end))) { |
if (!($start && ($now<$start)) || !($end && ($now>$end))) { |
my $reply=&Apache::lonnet::modifystudent |
my $reply=&Apache::lonnet::modifystudent |
($udom,$unam,'','','','','','','',$section,time); |
($udom,$unam,'','','','','','','', |
|
$section,time,undef,undef,$desiredhost); |
} |
} |
} |
} |
} |
} |
Line 534 sub enroll_single_student {
|
Line 535 sub enroll_single_student {
|
if (!$genpwd) { $genpwd=" "; } |
if (!$genpwd) { $genpwd=" "; } |
} |
} |
if (($amode) && ($genpwd)) { |
if (($amode) && ($genpwd)) { |
|
&modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
|
$ENV{'request.course.id'},$ENV{'form.csec'}, |
|
$desiredhost); |
$r->print(&Apache::lonnet::modifystudent( |
$r->print(&Apache::lonnet::modifystudent( |
$ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
$ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
$ENV{'form.cstid'},$amode,$genpwd, |
$ENV{'form.cstid'},$amode,$genpwd, |
Line 542 sub enroll_single_student {
|
Line 546 sub enroll_single_student {
|
$ENV{'form.csec'},$ENV{'form.enddate'}, |
$ENV{'form.csec'},$ENV{'form.enddate'}, |
$ENV{'form.startdate'},$ENV{'form.forceid'}, |
$ENV{'form.startdate'},$ENV{'form.forceid'}, |
$desiredhost)); |
$desiredhost)); |
&modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
|
$ENV{'request.course.id'},$ENV{'form.csec'}); |
|
} else { |
} else { |
$r->print('Invalid login mode or password'); |
$r->print('Invalid login mode or password'); |
} |
} |
Line 871 sub upfile_drop_add {
|
Line 873 sub upfile_drop_add {
|
} |
} |
} |
} |
if ($password) { |
if ($password) { |
|
&modifystudent($domain,$username,$cid,$sec, |
|
$desiredhost); |
my $reply=&Apache::lonnet::modifystudent |
my $reply=&Apache::lonnet::modifystudent |
($domain,$username,$id,$amode,$password, |
($domain,$username,$id,$amode,$password, |
$fname,$mname,$lname,$gen,$sec,$enddate, |
$fname,$mname,$lname,$gen,$sec,$enddate, |
$startdate,$ENV{'form.forceid'},$desiredhost); |
$startdate,$ENV{'form.forceid'},$desiredhost); |
&modifystudent($domain,$username,$cid,$sec); |
|
if ($reply ne 'ok') { |
if ($reply ne 'ok') { |
$r->print('<p><b>'. |
$r->print('<p><b>'. |
'Error enrolling '.$username.': '. |
'Error enrolling '.$username.': '. |