version 1.38, 2006/11/02 21:26:54
|
version 1.39, 2006/12/20 22:42:48
|
Line 30 package Apache::lonratsrv;
|
Line 30 package Apache::lonratsrv;
|
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
|
use LONCAPA(); |
use LONCAPA::map(); |
use LONCAPA::map(); |
|
|
|
|
Line 43 sub handler {
|
Line 44 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
my $url=$r->uri; |
my $url=$r->uri; |
$url=~/\/(\w+)\/ratserver$/; |
$url=~m{/(\w+)/ratserver$}; |
my $mode=$1; |
my $mode=$1; |
|
|
$url=~s/\/loadonly\/ratserver$/\/save\/ratserver/; |
$url=~s{/loadonly/ratserver$}{/save/ratserver}; |
|
|
my $fn=$r->filename; |
my $fn=$r->filename; |
my $lonDocRoot=$r->dir_config('lonDocRoot'); |
my $lonDocRoot=$r->dir_config('lonDocRoot'); |
if ( $fn =~ /\Q$lonDocRoot\E/ ) { |
if ( $fn =~ /\Q$lonDocRoot\E/ ) { |
#internal authentication, needs fixup. |
#internal authentication, needs fixup. |
$fn = $url; |
$fn = $url; |
$fn=~s|^/~(\w+)|/home/$1/public_html|; |
$fn=~s{^/~($LONCAPA::username_re)}{/home/$1/public_html}; |
$fn=~s|/[^/]*/ratserver$||; |
$fn=~s{/[^/]*/ratserver$}{}; |
} |
} |
my $errtext=''; |
my $errtext=''; |
my $infotext=''; |
my $infotext=''; |