version 1.5, 2001/05/03 11:04:07
|
version 1.6, 2001/05/09 16:57:07
|
Line 10
|
Line 10
|
# 03/23 Guy Albertelli |
# 03/23 Guy Albertelli |
# 03/24,03/29 Gerd Kortemeyer) |
# 03/24,03/29 Gerd Kortemeyer) |
# |
# |
# 03/31,04/03 Gerd Kortemeyer |
# 03/31,04/03,05/09 Gerd Kortemeyer |
|
|
package Apache::lonpubdir; |
package Apache::lonpubdir; |
|
|
Line 18 use strict;
|
Line 18 use strict;
|
use Apache::File; |
use Apache::File; |
use File::Copy; |
use File::Copy; |
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods); |
|
use Apache::loncacc; |
|
|
|
|
sub handler { |
sub handler { |
Line 33 sub handler {
|
Line 34 sub handler {
|
} else { |
} else { |
$fn=$r->filename(); |
$fn=$r->filename(); |
} |
} |
|
|
|
my $uname; |
|
my $udom; |
|
|
|
unless (($uname,$udom)= |
|
&Apache::loncacc::constructaccess( |
|
$fn,$r->dir_config('lonDefDomain'))) { |
|
$r->log_reason($uname.' at '.$udom. |
|
' trying to publish file '.$ENV{'form.filename'}. |
|
' ('.$fn.') - not authorized', |
|
$r->filename); |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
|
$fn=~s/\/$//; |
$fn=~s/\/$//; |
|
|
Line 44 sub handler {
|
Line 58 sub handler {
|
|
|
# ----------------------------------------------------------- Start page output |
# ----------------------------------------------------------- Start page output |
|
|
my $uname=$ENV{'user.name'}; |
|
my $udom=$ENV{'user.domain'}; |
|
|
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
Line 59 sub handler {
|
Line 71 sub handler {
|
$thisdisfn=~s/^\/home\/$uname\/public_html//; |
$thisdisfn=~s/^\/home\/$uname\/public_html//; |
|
|
$r->print('<h1>Construction Space Directory <tt>'.$thisdisfn.'/</tt></h1>'); |
$r->print('<h1>Construction Space Directory <tt>'.$thisdisfn.'/</tt></h1>'); |
|
|
|
if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) { |
|
$r->print('<h3><font color=red>Co-Author: '.$uname.' at '.$udom. |
|
'</font></h3>'); |
|
} |
|
|
|
|
my $docroot=$r->dir_config('lonDocRoot'); |
my $docroot=$r->dir_config('lonDocRoot'); |
|
|