[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm

ng lon-capa-cvs@mail.lon-capa.org
Tue, 30 Jul 2002 19:47:13 -0000


ng		Tue Jul 30 15:47:13 2002 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  add a filter so that files a user does not have permission to view are not
  listed.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.46 loncom/interface/lonindexer.pm:1.47
--- loncom/interface/lonindexer.pm:1.46	Tue Jul  2 17:08:24 2002
+++ loncom/interface/lonindexer.pm	Tue Jul 30 15:47:13 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.46 2002/07/02 21:08:24 ng Exp $
+# $Id: lonindexer.pm,v 1.47 2002/07/30 19:47:13 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -723,6 +723,8 @@
 
 # display file
     if ($fnptr == 0 and $filecom[3] ne '') {
+	my $filelink = $startdir.$filecom[0];
+	return OK if (!&Apache::lonnet::allowed('bre',$filelink));
 	my @file_ext = split (/\./,$listname);
 	my $curfext = $file_ext[-1];
         if (@Omit) {
@@ -740,7 +742,6 @@
 	$iconname = $curfext.".gif" unless
 	    (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');
 	#
-	my $filelink = $startdir.$filecom[0];
 	$r->print("<tr bgcolor=$fileclr><td nowrap valign='bottom'>");
 	my $metafile = grep /^$filecom[0]\.meta\&/, @list;
 	my $title;