--- loncom/interface/lonnavmaps.pm 2002/09/01 19:29:00 1.44 +++ loncom/interface/lonnavmaps.pm 2002/09/05 19:47:29 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.44 2002/09/01 19:29:00 www Exp $ +# $Id: lonnavmaps.pm,v 1.48 2002/09/05 19:47:29 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,6 +67,10 @@ my %courseopt; my %useropt; my %parmhash; +# This parameter keeps track of whether obtaining the user's information +# failed, which the colorizer in astatus can use +my $networkFailedFlag = 0; + # ------------------------------------------------------------------ Euclid gcd sub euclid { @@ -458,9 +462,9 @@ sub handler { my ($cdom,$cnum)=split(/\_/,$cid); my $userprefix=$uname.'_'.$udom.'_'; - + unless ($uhome eq 'no_host') { -# -------------------------------------------------------------- Get coursedata +# ------------------------------------------------- Get coursedata (if present) unless ((time-$courserdatas{$cid.'.last_cache'})<240) { my $reply=&Apache::lonnet::reply('dump:'.$cdom.':'.$cnum. ':resourcedata',$chome); @@ -468,6 +472,11 @@ sub handler { $courserdatas{$cid}=$reply; $courserdatas{$cid.'.last_cache'}=time; } + # check to see if network failed + elsif ( $reply=~/no.such.host/i || $reply=~/con.*lost/i ) + { + $networkFailedFlag = 1; + } } foreach (split(/\&/,$courserdatas{$cid})) { my ($name,$value)=split(/\=/,$_); @@ -584,6 +593,15 @@ sub handler { ($currenturl!~/^\/res\/adm/)) { $r->print('Current Location
'); } + + # Handle a network error + + if ($networkFailedFlag) + { + $r->print('
LON-CAPA's network is having difficulties, some problem" . + " information, such as due dates, will not be available."); + } # ----------------------------------------------------- The little content list for ($i=0;$i<=$#rows;$i++) { if ($rows[$i]) { @@ -607,6 +625,8 @@ sub handler { $r->print("\n