version 1.54, 2002/09/26 13:29:44
|
version 1.55, 2002/09/26 14:04:34
|
Line 594 sub enroll_single_student {
|
Line 594 sub enroll_single_student {
|
my $home = &Apache::lonnet::homeserver($ENV{'form.cuname'}, |
my $home = &Apache::lonnet::homeserver($ENV{'form.cuname'}, |
$ENV{'form.lcdomain'}); |
$ENV{'form.lcdomain'}); |
if ((($amode) && ($genpwd)) || ($home ne 'no_host')) { |
if ((($amode) && ($genpwd)) || ($home ne 'no_host')) { |
|
# Clean out any old roles the student has in this class. |
&modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
&modifystudent($ENV{'form.lcdomain'},$ENV{'form.cuname'}, |
$ENV{'request.course.id'},$ENV{'form.csec'}, |
$ENV{'request.course.id'},$ENV{'form.csec'}, |
$desiredhost); |
$desiredhost); |
$r->print(&Apache::lonnet::modifystudent( |
my $login_result = &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, |
$ENV{'form.cfirst'},$ENV{'form.cmiddle'}, |
$ENV{'form.cfirst'},$ENV{'form.cmiddle'}, |
$ENV{'form.clast'},$ENV{'form.cgen'}, |
$ENV{'form.clast'},$ENV{'form.cgen'}, |
$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); |
|
if ($login_result =~ /^ok/) { |
|
$r->print($login_result); |
|
$r->print("<p> If active, the new role will be available ". |
|
"when the student next logs in to LON-CAPA.</p>"); |
|
} else { |
|
$r->print("unable to enroll: ".$login_result); |
|
} |
} else { |
} else { |
$r->print('<p><font color="#ff0000">ERROR</font> '. |
$r->print('<p><font color="#ff0000">ERROR</font> '. |
'Invalid login mode or password. '. |
'Invalid login mode or password. '. |
Line 1391 sub upfile_drop_add {
|
Line 1399 sub upfile_drop_add {
|
} |
} |
} |
} |
} # end of foreach (@studentdata) |
} # end of foreach (@studentdata) |
$r->print('<p>Processed Students: '.$count); |
$r->print('<p>Processed Students: '.$count.'</p>'); |
|
$r->print("<p>If active, the new role will be available when the ". |
|
"students next log in to LON-CAPA.</p>"); |
##################################### |
##################################### |
# Drop students # |
# Drop students # |
##################################### |
##################################### |
Line 1568 sub handler {
|
Line 1578 sub handler {
|
} elsif ($ENV{'form.state'} eq 'done') { |
} elsif ($ENV{'form.state'} eq 'done') { |
&drop_student_list($r); |
&drop_student_list($r); |
} else { |
} else { |
&menu_phase_two_drop($r); |
&print_drop_menu($r); |
} |
} |
} elsif ($ENV{'form.action'} eq 'enrollstudent') { |
} elsif ($ENV{'form.action'} eq 'enrollstudent') { |
if (! exists($ENV{'form.state'})) { |
if (! exists($ENV{'form.state'})) { |