--- loncom/interface/londocs.pm 2002/10/15 20:50:19 1.27 +++ loncom/interface/londocs.pm 2002/10/16 18:48:12 1.28 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.27 2002/10/15 20:50:19 www Exp $ +# $Id: londocs.pm,v 1.28 2002/10/16 18:48:12 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,7 +29,7 @@ package Apache::londocs; use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonnet; use Apache::loncommon; use Apache::lonratedt; @@ -256,9 +256,11 @@ sub handler { $r->print('Verify Content'. &Apache::loncommon::bodytag('Verify Course Documents')); $hashtied=0; + my %alreadyseen=(); &tiehash(); foreach (keys %hash) { - if ($_=~/^src\_(.+)$/) { + if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { + $alreadyseen{$hash{$_}}=1; my $resid=$1; $r->rflush(); if ($hash{$_}) { @@ -266,17 +268,18 @@ sub handler { $r->print('
'. ($hash{'title_'.$resid}?$hash{'title_'.$resid}:$fn).' '); if ($fn=~/^\/res\//) { - my $result=&Apache::lonnet::repcopy($fn); - if ($result eq OK) { + my $result=&Apache::lonnet::repcopy( + &Apache::lonnet::filelocation('',$fn)); + if ($result==OK) { $r->print('ok'); $r->rflush(); my $dependencies= - &Apache::lonnet::metadata($_,'dependencies'); - $r->print('Dependencies: '.$dependencies.'
'); - } elsif ($result eq HTTP_SERVICE_UNAVAILABLE) { + &Apache::lonnet::metadata($hash{$_},'dependencies'); + $r->print('Dependencies: '.$dependencies.'
'); + } elsif ($result==HTTP_SERVICE_UNAVAILABLE) { $r->print( 'connection down'); - } elsif ($result eq HTTP_NOT_FOUND) { + } elsif ($result==HTTP_NOT_FOUND) { $r->print('not found'); } else { $r->print(