--- loncom/interface/lonindexer.pm 2003/02/03 18:03:52 1.59
+++ loncom/interface/lonindexer.pm 2003/06/14 00:15:01 1.66
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.59 2003/02/03 18:03:52 harris41 Exp $
+# $Id: lonindexer.pm,v 1.66 2003/06/14 00:15:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -124,7 +124,7 @@ sub handler {
$extrafield='';
my $diropendb =
- "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db";
+ "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_indexer.db";
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
if ($ENV{'form.launch'} eq '1') {
@@ -390,11 +390,12 @@ $r->print(&Apache::loncommon::bodytag('B
Size
Last access
Last modified
-
Show Resource
+
All versions
Author
Keywords
Language
-
All versions
+
Show Resource
+
@@ -428,7 +429,7 @@ END
$r->print("
Language
\n")
if ($hash{'display_attrs_6'} == 1);
$r->print("
Resource
\n")
- if ($hash{'display_attrs_8'} == 1);
+ if ($hash{'display_attrs_7'} == 1);
$r->print('');
# ----------------- read in what directories have previously been set to "open"
@@ -514,12 +515,12 @@ sub scanDir {
my ($strip,$dom,undef,$testdir,undef)=split(/\&/,$line,5);
next if $strip =~ /.*\.meta$/;
my (@fileparts) = split(/\./,$strip);
- if ($hash{'display_attrs_7'} != 1) {
+ if ($hash{'display_attrs_8'} != 1) {
if (scalar(@fileparts) >= 3) {
my $fext = pop @fileparts;
my $ov = pop @fileparts;
my $fname = join ('.',@fileparts,$fext);
- next if (grep /$fname/,@list and $ov =~ /\d+/);
+ next if (grep /\Q$fname\E/,@list and $ov =~ /\d+/);
}
}
@@ -638,16 +639,18 @@ sub display_line {
my $tabtag='';
my $i=0;
- while ($i<=6) {
+ while ($i<=7) {
$tabtag=join('',$tabtag,"
")
if $hash{'display_attrs_'.$i} == 1;
$i++;
}
+
+ my $valign = ($hash{'display_attrs_7'} == 1 ? 'top' : 'bottom');
# display uplink arrow
if ($filecom[1] eq 'viewOneUp') {
$r->print("
$extrafield");
- $r->print("
\n");
+ $r->print("
\n");
$r->print ('
\n");
return OK;
}
+# Do we have permission to look at this?
+
+ return OK if (!&Apache::lonnet::allowed('bre',$startdir.$filecom[0]));
# display domain
if ($filecom[1] eq 'domain') {
$r->print (''."\n")
if ($ENV{'form.dirPointer'} eq "on");
$r->print("
");
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$titleesc;
$fnum++;
@@ -798,46 +811,44 @@ sub display_line {
if ($hash{'display_attrs_0'} == 1) {
my $title = &Apache::lonnet::metadata($filelink,'title')
if ($metafile == 1);
- $r->print('
'.($title eq '' ? ' ' : $title).
+ $r->print('
'.($title eq '' ? ' ' : $title).
'
'."\n");
}
- $r->print('
',
+ $r->print('
',
$filecom[8],"
\n")
if $hash{'display_attrs_1'} == 1;
- $r->print('
'.
+ $r->print('
'.
(localtime($filecom[9]))."
\n")
if $hash{'display_attrs_2'} == 1;
- $r->print('
'.
+ $r->print('
'.
(localtime($filecom[10]))."
\n")
if $hash{'display_attrs_3'} == 1;
if ($hash{'display_attrs_4'} == 1) {
my $author = &Apache::lonnet::metadata($filelink,'author')
if ($metafile == 1);
- $r->print('
'.($author eq '' ? ' ' : $author).
+ $r->print('
'.($author eq '' ? ' ' : $author).
"
\n");
}
if ($hash{'display_attrs_5'} == 1) {
my $keywords = &Apache::lonnet::metadata($filelink,'keywords')
if ($metafile == 1);
# $keywords = ' ' if (!$keywords);
- $r->print('