--- loncom/publisher/lonretrieve.pm 2005/01/05 17:38:27 1.26
+++ loncom/publisher/lonretrieve.pm 2005/04/07 06:56:27 1.27
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to retrieve an old version of a file
#
-# $Id: lonretrieve.pm,v 1.26 2005/01/05 17:38:27 www Exp $
+# $Id: lonretrieve.pm,v 1.27 2005/04/07 06:56:27 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,7 @@ use Apache::Constants qw(:common :http :
use Apache::loncacc;
use Apache::loncommon();
use Apache::lonlocal;
+use Apache::lonnet;
# ------------------------------------ Interface for selecting previous version
sub phaseone {
@@ -110,8 +111,8 @@ sub phaseone {
# ---------------------------------- Interface for presenting specified version
sub phasetwo {
my ($r,$fn,$uname,$udom)=@_;
- if ($ENV{'form.version'}) {
- my $version=$ENV{'form.version'};
+ if ($env{'form.version'}) {
+ my $version=$env{'form.version'};
if ($version eq 'new') {
$r->print('
'.&mt('Retrieving current (most recent) version').'
');
} else {
@@ -162,17 +163,17 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['filename']);
- if ($ENV{'form.filename'}) {
- $fn=$ENV{'form.filename'};
+ if ($env{'form.filename'}) {
+ $fn=$env{'form.filename'};
$fn=~s/^http\:\/\/[^\/]+//;
} else {
- $r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}.
+ $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
' unspecified filename for retrieval', $r->filename);
return HTTP_NOT_FOUND;
}
unless ($fn) {
- $r->log_reason($ENV{'user.name'}.' at '.$ENV{'user.domain'}.
+ $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
' trying to retrieve non-existing file', $r->filename);
return HTTP_NOT_FOUND;
}
@@ -185,7 +186,7 @@ sub handler {
&Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
unless (($uname) && ($udom)) {
$r->log_reason($uname.' at '.$udom.
- ' trying to publish file '.$ENV{'form.filename'}.
+ ' trying to publish file '.$env{'form.filename'}.
' ('.$fn.') - not authorized',
$r->filename);
return HTTP_NOT_ACCEPTABLE;
@@ -203,14 +204,14 @@ sub handler {
$r->print(''.&mt('Retrieve previous versions of').' '.$fn.'
');
- if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) {
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
$r->print(''.&mt('Co-Author').': '.$uname.
&mt(' at ').$udom.
'
');
}
- if ($ENV{'form.phase'} eq 'two') {
+ if ($env{'form.phase'} eq 'two') {
&phasetwo($r,$fn,$uname,$udom);
} else {
&phaseone($r,$fn,$uname,$udom);