--- loncom/interface/spreadsheet/lonspreadsheet.pm 2003/06/19 16:04:06 1.13 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2003/07/16 13:52:19 1.16 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.13 2003/06/19 16:04:06 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.16 2003/07/16 13:52:19 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -238,13 +238,6 @@ sub handler { $name = $ENV{'form.sname'}; $domain = $ENV{'form.sdomain'}; } - # - # Open page, try to prevent browser cache. - # - $r->content_type('text/html'); - $r->header_out('Cache-control','no-cache'); - $r->header_out('Pragma','no-cache'); - $r->send_http_header; ## ## Check permissions my $allowed_to_edit = &Apache::lonnet::allowed('mgr', @@ -265,10 +258,10 @@ sub handler { # if they are not requesting their own. if ($sheettype eq 'classcalc') { if (! $allowed_to_view) { - $r->print('

Access Permission Denied

'. - ''); - return OK; - } + $ENV{'user.error.msg'}= + $r->uri.":vgr:0:0:Access Permission Denied"; + return HTTP_NOT_ACCEPTABLE; + } } if ((($name ne $ENV{'user.name'} ) || ($domain ne $ENV{'user.domain'})) && $sheettype ne 'classcalc') { @@ -278,15 +271,21 @@ sub handler { my $stu_sec = &Apache::lonnet::usection($domain,$name, $ENV{'request.course.id'}); if ($stu_sec ne $ENV{'request.course.sec'}) { - $r->print - ('

The student requested is not in your section.

'. - ''); - return OK; + $ENV{'user.error.msg'}= + $r->uri.":vgr:0:0:Requested student not in your section."; + return HTTP_NOT_ACCEPTABLE; } } } # + # Open page, try to prevent browser cache. + # + $r->content_type('text/html'); + &Apache::loncommon::no_cache($r); + $r->send_http_header; + + # # Header.... # $r->print('LON-CAPA Spreadsheet'); @@ -430,6 +429,7 @@ END if ($allowed_to_view || $allowed_to_edit) { $r->print($spreadsheet->parent_link()); } + $r->rflush(); $spreadsheet->display($r); } $r->print('');