version 1.14, 2011/10/29 19:17:09
|
version 1.17, 2012/10/29 17:38:55
|
Line 34 use strict;
|
Line 34 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; |
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 393 sub handler {
|
Line 392 sub handler {
|
|
|
if ($env{'form.filename'}) { |
if ($env{'form.filename'}) { |
$fn=$env{'form.filename'}; |
$fn=$env{'form.filename'}; |
$fn=~s/^https?\:\/\/[^\/]+//; |
$fn=~s{^https?\://[^/]+}{}; |
} else { |
} else { |
$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. |
$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. |
' unspecified filename for cleanup', $r->filename); |
' unspecified filename for cleanup', $r->filename); |
Line 410 sub handler {
|
Line 409 sub handler {
|
my $uname; |
my $uname; |
my $udom; |
my $udom; |
|
|
($uname,$udom)=&Apache::loncacc::constructaccess($fn); |
($uname,$udom)=&Apache::lonnet::constructaccess($fn); |
unless (($uname) && ($udom)) { |
unless (($uname) && ($udom)) { |
$r->log_reason($uname.' at '.$udom. |
$r->log_reason($uname.' at '.$udom. |
' trying to cleanup file '.$env{'form.filename'}. |
' trying to cleanup file '.$env{'form.filename'}. |
Line 419 sub handler {
|
Line 418 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
$fn=~s{^/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{}; |
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
# Breadcrumbs |
# Breadcrumbs |
my $brcrum = [{'href' => &Apache::loncommon::authorspace(), |
my $brcrum = [{'href' => &Apache::loncommon::authorspace($fn), |
'text' => 'Construction Space'}, |
'text' => 'Construction Space'}, |
{'href' => '', |
{'href' => '', |
'text' => 'Cleanup XML Document'}]; |
'text' => 'Cleanup XML Document'}]; |
|
|
|
$fn=~s{^/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{}; |
|
|
$r->print(&Apache::loncommon::start_page('Cleanup XML Document', |
$r->print(&Apache::loncommon::start_page('Cleanup XML Document', |
undef, |
undef, |
{'bread_crumbs' => $brcrum,})); |
{'bread_crumbs' => $brcrum,})); |