[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
www
lon-capa-cvs@mail.lon-capa.org
Wed, 16 Oct 2002 18:48:12 -0000
www Wed Oct 16 14:48:12 2002 EDT
Modified files:
/loncom/interface londocs.pm
Log:
Additional work on Verify
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.27 loncom/interface/londocs.pm:1.28
--- loncom/interface/londocs.pm:1.27 Tue Oct 15 16:50:19 2002
+++ loncom/interface/londocs.pm Wed Oct 16 14:48:12 2002
@@ -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 @@
$r->print('<html><head><title>Verify Content</title></head>'.
&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 @@
$r->print('<br /><a href="'.$fn.'" target="cat">'.
($hash{'title_'.$resid}?$hash{'title_'.$resid}:$fn).'</a> ');
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('<font color="green">ok</font>');
$r->rflush();
my $dependencies=
- &Apache::lonnet::metadata($_,'dependencies');
- $r->print('Dependencies: '.$dependencies.'<br>');
- } elsif ($result eq HTTP_SERVICE_UNAVAILABLE) {
+ &Apache::lonnet::metadata($hash{$_},'dependencies');
+ $r->print('Dependencies: '.$dependencies.'<br />');
+ } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {
$r->print(
'<font color="red"><b>connection down</b></font>');
- } elsif ($result eq HTTP_NOT_FOUND) {
+ } elsif ($result==HTTP_NOT_FOUND) {
$r->print('<font color="red"><b>not found</b></font>');
} else {
$r->print(