[LON-CAPA-cvs] cvs: loncom /interface multidownload.pl

banghart lon-capa-cvs-allow@mail.lon-capa.org
Thu, 26 Apr 2007 17:36:11 -0000


banghart		Thu Apr 26 13:36:11 2007 EDT

  Modified files:              
    /loncom/interface	multidownload.pl 
  Log:
  	Correct determination of download privilege.
  
  
Index: loncom/interface/multidownload.pl
diff -u loncom/interface/multidownload.pl:1.5 loncom/interface/multidownload.pl:1.6
--- loncom/interface/multidownload.pl:1.5	Wed Apr 25 21:04:21 2007
+++ loncom/interface/multidownload.pl	Thu Apr 26 13:36:10 2007
@@ -2,7 +2,7 @@
 # CGI-script to allow download of all essay submissions of 
 # multiple students.
 #
-# $Id: multidownload.pl,v 1.5 2007/04/26 01:04:21 banghart Exp $
+# $Id: multidownload.pl,v 1.6 2007/04/26 17:36:10 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,8 +62,12 @@
 &Apache::loncommon::content_type(undef,'text/html');
 my $identifier = $ENV{'QUERY_STRING'};
 print(&Apache::loncommon::start_page('Multiple Downloads'));
-my $scope .= '/'.$env{'request.course.sec'};
-if (&Apache::lonnet::allowed('vgr',$scope)) {
+
+my $scope = $env{'request.course.id'};
+if ($env{'request.course.sec'}) {
+    $scope .= '/'.$env{'request.course.sec'};
+}
+if (&Apache::lonnet::allowed('vgr',$scope) eq 'F') {
     my $symb = $env{'cgi.'.$identifier.'.symb'};
     my $courseid = $env{'request.course.id'};
     my @stuchecked = split(/\n/,$env{'cgi.'.$identifier.'.students'});
@@ -107,4 +111,5 @@
 } else {
     print('You are not authorized to download student submissions.');
 }
-
+1;
+__END__;