--- loncom/interface/Attic/londropadd.pm 2003/08/26 04:56:29 1.84
+++ 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.84 2003/08/26 04:56:29 albertel Exp $
+# $Id: londropadd.pm,v 1.87 2003/11/05 20:55:59 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,6 +42,7 @@ use Apache::loncommon();
use Apache::lonhtmlcommon();
use Apache::Constants qw(:common :http REDIRECT);
use Spreadsheet::WriteExcel;
+use Apache::lonlocal;
###############################################################
###############################################################
@@ -79,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});
@@ -521,7 +522,7 @@ sub print_upload_manager_form {
my $distotal=$total+1;
my $today=time;
my $halfyear=$today+15552000;
- my $defdom=$ENV{'request.role.domain'};
+ my $defdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
my ($krbdef,$krbdefdom) =
&Apache::loncommon::get_kerberos_defaults($defdom);
&print_upload_manager_header($r,$datatoken,$distotal,$krbdefdom);
@@ -723,7 +724,7 @@ sub make_dates_default {
sub get_student_username_domain_form {
my $r = shift;
my $domform = &Apache::loncommon::select_dom_form
- ($ENV{'request.role.domain'},'cudomain',0);
+ ($ENV{'course.'.$ENV{'request.course.id'}.'.domain'},'cudomain',0);
$r->print(<
'.$starttime.'
'); + return; + } # Deal with date forms my $date_table = &date_setting_table($starttime,$endtime); # @@ -1348,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 = ''; @@ -1801,7 +1806,7 @@ The response to the request is governed sub handler { my $r=shift; if ($r->header_only) { - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK; } @@ -1822,7 +1827,7 @@ sub handler { $r->content_type('text/csv'); } else { # Start page - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; $r->print(&header()); }