--- loncom/auth/lonuploadedacc.pm 2002/12/04 15:23:39 1.7 +++ loncom/auth/lonuploadedacc.pm 2004/10/26 15:03:08 1.11 @@ -1,7 +1,7 @@ # The LearningOnline Network # Access Handler for User Files # -# $Id: lonuploadedacc.pm,v 1.7 2002/12/04 15:23:39 www Exp $ +# $Id: lonuploadedacc.pm,v 1.11 2004/10/26 15:03:08 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,14 +43,14 @@ package Apache::lonuploadedacc; # H now must ask S if token is valid, uses S's lond-command tokenauthuserfile use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonnet(); sub handler { my $r = shift; my $args=$r->args; &Apache::loncommon::get_unprocessed_cgi($args,['token','tokenissued']); - my (undef,undef,$udom,$uname,$ufile)=split(/\//,$r->uri); + my (undef,undef,$udom,$uname,$ufile)=split(/\//,$r->uri,5); $ufile=~s/^[\~\.]+//; my $remoteserver=$ENV{'form.tokenissued'}; my $reply=&Apache::lonnet::reply('tokenauthuserfile:'. @@ -58,9 +58,11 @@ sub handler { $remoteserver); if ($reply eq 'ok') { return OK; + } elsif ($reply eq 'con_lost' || $reply eq 'no_such_host') { + &Apache::lonnet::logthis("Server unavailable for userfile access $uname at $udom for $ufile with $remoteserver token $ENV{'form.token'}: $reply"); + return HTTP_SERVICE_UNAVAILABLE; } else { - &Apache::lonnet::logthis( -"Refused userfile access $uname at $udom for $ufile with $remoteserver token $ENV{'form.token'}: $reply"); + &Apache::lonnet::logthis("Refused userfile access $uname at $udom for $ufile with $remoteserver token $ENV{'form.token'}: $reply"); return FORBIDDEN; } }