version 1.17, 2001/12/15 20:48:47
|
version 1.20, 2002/01/18 16:48:41
|
Line 37
|
Line 37
|
# 03/24,03/29 Gerd Kortemeyer) |
# 03/24,03/29 Gerd Kortemeyer) |
# 03/31,04/03,05/09,06/23,08/18,08/20 Gerd Kortemeyer |
# 03/31,04/03,05/09,06/23,08/18,08/20 Gerd Kortemeyer |
# 12/15 Scott Harrison |
# 12/15 Scott Harrison |
|
# 12/28 Gerd Kortemeyer |
# |
# |
### |
### |
|
|
Line 110 sub handler {
|
Line 111 sub handler {
|
my $docroot=$r->dir_config('lonDocRoot'); |
my $docroot=$r->dir_config('lonDocRoot'); |
|
|
my $resdir=$docroot.'/res/'.$udom.'/'.$uname.$thisdisfn; |
my $resdir=$docroot.'/res/'.$udom.'/'.$uname.$thisdisfn; |
|
my $targetdir=$udom.'/'.$uname.$thisdisfn; |
my $linkdir='/~'.$uname.$thisdisfn; |
my $linkdir='/~'.$uname.$thisdisfn; |
|
|
$r->print('<table border=2>'. |
$r->print('<table border=2>'. |
'<tr><th>Filename</th><th>Modified</th><th>Status</th><th> </th></tr>'); |
'<tr><th>Filename</th><th>Metadata</th><th>Modified</th>'. |
|
'<th>Status</th><th> </th></tr>'); |
|
|
my $filename; |
my $filename; |
my $dirptr=16384; |
my $dirptr=16384; |
Line 136 sub handler {
|
Line 139 sub handler {
|
unless ((($filename eq '..') && ($thisdisfn eq '')) || |
unless ((($filename eq '..') && ($thisdisfn eq '')) || |
($filename eq '.')) { |
($filename eq '.')) { |
$r->print('<tr bgcolor=#BBBBFF'. |
$r->print('<tr bgcolor=#BBBBFF'. |
'><td><a href="'.$linkdir.'/'.$filename.'">'.$disfilename. |
'><td><a href="'.$linkdir.'/'.$filename.'/">'.$disfilename. |
'</a></td><td>'.localtime($cmtime).'</td><td> </td><td> </td></tr>' |
'</a></td><td> </td><td>'.localtime($cmtime). |
|
'</td><td> </td><td> </td></tr>' |
); |
); |
} |
} |
} elsif (&Apache::loncommon::fileembstyle($extension) ne 'hdn') { |
} elsif (&Apache::loncommon::fileembstyle($extension) ne 'hdn') { |
my $status='Unpublished'; |
my $status='Unpublished'; |
my $bgcol='#FFBBBB'; |
my $bgcol='#FFBBBB'; |
|
my $title=' '; |
if (-e $resdir.'/'.$filename) { |
if (-e $resdir.'/'.$filename) { |
my ($rdev,$rino,$rmode,$rnlink, |
my ($rdev,$rino,$rmode,$rnlink, |
$ruid,$rgid,$rrdev,$rsize, |
$ruid,$rgid,$rrdev,$rsize, |
Line 151 sub handler {
|
Line 156 sub handler {
|
if ($rmtime>=$cmtime) { |
if ($rmtime>=$cmtime) { |
$status='Published'; |
$status='Published'; |
$bgcol='#BBFFBB'; |
$bgcol='#BBFFBB'; |
|
$title= |
|
'<a href="/res/'.$targetdir.'/'.$filename.'.meta" target=cat>'. |
|
&Apache::lonnet::metadata($targetdir.'/'.$filename,'title').'</a>'; |
} else { |
} else { |
$status='Modified'; |
$status='Modified'; |
$bgcol='#FFFFBB'; |
$bgcol='#FFFFBB'; |
|
$title= |
|
'<a href="/res/'.$targetdir.'/'.$filename.'.meta" target=cat>'. |
|
&Apache::lonnet::metadata($targetdir.'/'.$filename,'title').'</a>'; |
if |
if |
(&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') { |
(&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') { |
$status.='<br><a href="/adm/diff?filename=/~'.$uname. |
$status.='<br><a href="/adm/diff?filename=/~'.$uname. |
Line 166 sub handler {
|
Line 177 sub handler {
|
} |
} |
$r->print('<tr bgcolor='.$bgcol. |
$r->print('<tr bgcolor='.$bgcol. |
'><td><a href="'.$linkdir.'/'.$filename.'">'.$filename. |
'><td><a href="'.$linkdir.'/'.$filename.'">'.$filename. |
'</a></td><td>'.localtime($cmtime).'</td><td>'.$status.'</td>'. |
'</a></td><td>'.$title. |
|
'<td>'.localtime($cmtime).'</td><td>'.$status.'</td>'. |
'<td><a target="_parent" href="/adm/publish?filename=/~'.$uname. |
'<td><a target="_parent" href="/adm/publish?filename=/~'.$uname. |
$thisdisfn.'/'.$filename.'">'. |
$thisdisfn.'/'.$filename.'">'. |
'Publish</a></td></tr>'); |
'Publish</a></td></tr>'); |
Line 191 Apache::lonpubdir - Publication Handler
|
Line 203 Apache::lonpubdir - Publication Handler
|
|
|
Invoked (for various locations) by /etc/httpd/conf/srm.conf: |
Invoked (for various locations) by /etc/httpd/conf/srm.conf: |
|
|
<LocationMatch "^/\~.*/$"> |
<LocationMatch "^/\~.*/$"> |
PerlAccessHandler Apache::loncacc |
PerlAccessHandler Apache::loncacc |
SetHandler perl-script |
SetHandler perl-script |
PerlHandler Apache::lonpubdir |
PerlHandler Apache::lonpubdir |
ErrorDocument 403 /adm/login |
ErrorDocument 403 /adm/login |
ErrorDocument 404 /adm/notfound.html |
ErrorDocument 404 /adm/notfound.html |
ErrorDocument 406 /adm/unauthorized.html |
ErrorDocument 406 /adm/unauthorized.html |
ErrorDocument 500 /adm/errorhandler |
ErrorDocument 500 /adm/errorhandler |
</LocationMatch> |
</LocationMatch> |
|
|
<Location /adm/pubdir> |
<Location /adm/pubdir> |
PerlAccessHandler Apache::lonacc |
PerlAccessHandler Apache::lonacc |
SetHandler perl-script |
SetHandler perl-script |
PerlHandler Apache::lonpubdir |
PerlHandler Apache::lonpubdir |
ErrorDocument 403 /adm/login |
ErrorDocument 403 /adm/login |
ErrorDocument 404 /adm/notfound.html |
ErrorDocument 404 /adm/notfound.html |
ErrorDocument 406 /adm/unauthorized.html |
ErrorDocument 406 /adm/unauthorized.html |
ErrorDocument 500 /adm/errorhandler |
ErrorDocument 500 /adm/errorhandler |
</Location> |
</Location> |
|
|
=head1 INTRODUCTION |
=head1 INTRODUCTION |
|
|
This module enables cookie based authentication and is used |
This module publishes a directory of files. |
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 is part of the LearningOnline Network with CAPA project |
This is part of the LearningOnline Network with CAPA project |
described at http://www.lon-capa.org. |
described at http://www.lon-capa.org. |