--- loncom/interface/lonindexer.pm 2003/03/14 16:12:14 1.62
+++ loncom/interface/lonindexer.pm 2003/06/13 23:42:45 1.65
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.62 2003/03/14 16:12:14 albertel Exp $
+# $Id: lonindexer.pm,v 1.65 2003/06/13 23:42:45 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/$domain\_$ENV{'user.name'}_$ENV{'user.domain'}_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,7 +515,7 @@ 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;
@@ -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("
$extrafield");
- $r->print("
");
+ $r->print("
");
&begin_form ($r,$filecom[0].'/');
my $anchor = $filecom[0].'/';
$anchor =~ s/\///g;
@@ -694,7 +700,7 @@ sub display_line {
}
if ($filecom[1] eq 'user') {
$r->print("
$extrafield");
- $r->print("
\n");
+ $r->print("
\n");
my $curdir = $startdir.$filecom[0].'/';
my $anchor = $curdir;
$anchor =~ s/\///g;
@@ -720,7 +726,6 @@ sub display_line {
# 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) {
@@ -738,7 +743,7 @@ sub display_line {
$iconname = $curfext.".gif" unless
(!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');
#
- $r->print("
");
+ $r->print("
");
my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list;
my $title;
if ($ENV{'form.catalogmode'} eq 'interactive') {
@@ -752,7 +757,7 @@ sub display_line {
$titleesc,"','",$filelink,"')\">");
$r->print("".
"\n");
- $r->print("
");
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$titleesc;
$fnum++;
@@ -806,40 +811,40 @@ 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('