--- loncom/publisher/lonpubdir.pm 2001/12/15 20:48:47 1.17 +++ loncom/publisher/lonpubdir.pm 2001/12/28 22:14:10 1.19 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonpubdir.pm,v 1.17 2001/12/15 20:48:47 harris41 Exp $ +# $Id: lonpubdir.pm,v 1.19 2001/12/28 22:14:10 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ # 03/24,03/29 Gerd Kortemeyer) # 03/31,04/03,05/09,06/23,08/18,08/20 Gerd Kortemeyer # 12/15 Scott Harrison +# 12/28 Gerd Kortemeyer # ### @@ -110,10 +111,12 @@ sub handler { my $docroot=$r->dir_config('lonDocRoot'); my $resdir=$docroot.'/res/'.$udom.'/'.$uname.$thisdisfn; + my $targetdir=$udom.'/'.$uname.$thisdisfn; my $linkdir='/~'.$uname.$thisdisfn; $r->print(''. - ''); + ''. + ''); my $filename; my $dirptr=16384; @@ -137,12 +140,14 @@ sub handler { ($filename eq '.')) { $r->print('' + '' ); } } elsif (&Apache::loncommon::fileembstyle($extension) ne 'hdn') { my $status='Unpublished'; my $bgcol='#FFBBBB'; + my $title=' '; if (-e $resdir.'/'.$filename) { my ($rdev,$rino,$rmode,$rnlink, $ruid,$rgid,$rrdev,$rsize, @@ -151,9 +156,15 @@ sub handler { if ($rmtime>=$cmtime) { $status='Published'; $bgcol='#BBFFBB'; + $title= + ''. + &Apache::lonnet::metadata($targetdir.'/'.$filename,'title').''; } else { $status='Modified'; $bgcol='#FFFFBB'; + $title= + ''. + &Apache::lonnet::metadata($targetdir.'/'.$filename,'title').''; if (&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') { $status.='
'.$filename. - ''. + ''. ''); @@ -191,36 +203,29 @@ Apache::lonpubdir - Publication Handler Invoked (for various locations) by /etc/httpd/conf/srm.conf: - -PerlAccessHandler Apache::loncacc -SetHandler perl-script -PerlHandler Apache::lonpubdir -ErrorDocument 403 /adm/login -ErrorDocument 404 /adm/notfound.html -ErrorDocument 406 /adm/unauthorized.html -ErrorDocument 500 /adm/errorhandler - - - -PerlAccessHandler Apache::lonacc -SetHandler perl-script -PerlHandler Apache::lonpubdir -ErrorDocument 403 /adm/login -ErrorDocument 404 /adm/notfound.html -ErrorDocument 406 /adm/unauthorized.html -ErrorDocument 500 /adm/errorhandler - + + PerlAccessHandler Apache::loncacc + SetHandler perl-script + PerlHandler Apache::lonpubdir + ErrorDocument 403 /adm/login + ErrorDocument 404 /adm/notfound.html + ErrorDocument 406 /adm/unauthorized.html + ErrorDocument 500 /adm/errorhandler + + + + PerlAccessHandler Apache::lonacc + SetHandler perl-script + PerlHandler Apache::lonpubdir + ErrorDocument 403 /adm/login + ErrorDocument 404 /adm/notfound.html + ErrorDocument 406 /adm/unauthorized.html + ErrorDocument 500 /adm/errorhandler + =head1 INTRODUCTION -This module enables cookie based authentication and is used -to control access for many different LON-CAPA URIs. - -Whenever the client sends the cookie back to the server, -this cookie is handled by either lonacc.pm or loncacc.pm -(see srm.conf for what is invoked when). If -the cookie is missing or invalid, the user is re-challenged -for login information. +This module publishes a directory of files. This is part of the LearningOnline Network with CAPA project described at http://www.lon-capa.org.
FilenameModifiedStatus 
FilenameMetadataModifiedStatus 
'.$disfilename. - ''.localtime($cmtime).'  
 '.localtime($cmtime). + '  
'.localtime($cmtime).''.$status.''.$title. + ''.localtime($cmtime).''.$status.''. 'Publish