version 1.79, 2006/11/23 01:50:57
|
version 1.80, 2006/12/20 22:41:08
|
Line 72 use Apache::loncacc;
|
Line 72 use Apache::loncacc;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA; |
|
|
|
|
|
my $DEBUG=0; |
my $DEBUG=0; |
my $r; # Needs to be global for some stuff RF. |
my $r; # Needs to be global for some stuff RF. |
Line 151 sub URLToPath {
|
Line 150 sub URLToPath {
|
$Url=~ s/\/+/\//g; |
$Url=~ s/\/+/\//g; |
$Url=~ s/^http\:\/\/[^\/]+//; |
$Url=~ s/^http\:\/\/[^\/]+//; |
$Url=~ s/^\///; |
$Url=~ s/^\///; |
$Url=~ s/(\~|priv\/)(\w+)\//\/home\/$2\/public_html\//; |
$Url=~ s/(\~|priv\/)($match_username)\//\/home\/$2\/public_html\//; |
&Debug($r, "Returning $Url \n"); |
&Debug($r, "Returning $Url \n"); |
return $Url; |
return $Url; |
} |
} |
|
|
sub url { |
sub url { |
my $fn=shift; |
my $fn=shift; |
$fn=~s/^\/home\/(\w+)\/public\_html/\/priv\/$1/; |
$fn=~s/^\/home\/($match_username)\/public\_html/\/priv\/$1/; |
$fn=&HTML::Entities::encode($fn,'<>"&'); |
$fn=&HTML::Entities::encode($fn,'<>"&'); |
return $fn; |
return $fn; |
} |
} |
|
|
sub display { |
sub display { |
my $fn=shift; |
my $fn=shift; |
$fn=~s-^/home/(\w+)/public_html-/priv/$1-; |
$fn=~s-^/home/($match_username)/public_html-/priv/$1-; |
return '<tt>'.$fn.'</tt>'; |
return '<tt>'.$fn.'</tt>'; |
} |
} |
|
|