[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 16 Jan 2006 21:24:30 -0000


albertel		Mon Jan 16 16:24:30 2006 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  - BUG#4579, accessing lonannounce during course init could cause ISE
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.44 loncom/interface/lonannounce.pm:1.45
--- loncom/interface/lonannounce.pm:1.44	Fri Jan 13 10:28:36 2006
+++ loncom/interface/lonannounce.pm	Mon Jan 16 16:24:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.44 2006/01/13 15:28:36 albertel Exp $
+# $Id: lonannounce.pm,v 1.45 2006/01/16 21:24:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,12 +106,18 @@
 		my $realm=&mt('All Resources');
 		if ($middle=~/^(.+)\_\_\_\(all\)$/) {
 		    my $map_url=$1;
+		    if (!$can_see_hidden && !$navmap) {
+			next;
+		    }
 		    if (!$can_see_hidden) {
 			my $res = $navmap->getResourceByUrl($map_url);
 			if ($res && $res->randomout()) { next; }
 		    }
 		    $realm=&mt('Folder/Map').': '.&Apache::lonnet::gettitle($map_url);
 		} elsif ($middle) {
+		    if (!$can_see_hidden && !$navmap) {
+			next;
+		    }
 		    if (!$can_see_hidden) {
 			my $res = $navmap->getBySymb($middle);
 			if ($res && $res->randomout()) { next; }