[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonmenu.pm

raeburn raeburn@source.lon-capa.org
Tue, 30 Nov 2010 05:51:55 -0000


raeburn		Tue Nov 30 05:51:55 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	lonmenu.pm 
  Log:
  - Customization for GCI_3
    - Backport 1.319. 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.18 loncom/interface/lonmenu.pm:1.309.2.19
--- loncom/interface/lonmenu.pm:1.309.2.18	Mon Nov  8 22:51:23 2010
+++ loncom/interface/lonmenu.pm	Tue Nov 30 05:51:55 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.309.2.18 2010/11/08 22:51:23 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.19 2010/11/30 05:51:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -168,6 +168,11 @@
     my $numdc = &Apache::loncommon::check_for_gci_dc();
     # each element of @primary contains following array:
     # (link url, icon path, alt text, link text, condition)
+    my $public;
+    if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
+        || (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) {
+        $public = 1;
+    }
     foreach my $menuitem (@primary_menu) {
         # evaluate conditions 
         next if    ref($menuitem)       ne 'ARRAY';    #
@@ -176,11 +181,11 @@
         next if    $$menuitem[4]        eq 'newmsg'    # arrived or not
                 && !&Apache::lonmsg::mynewmail();      # 
         next if    $$menuitem[4]        !~ /public/    ##we've a public user, 
-                && $env{'user.name'}    eq 'public'    ##who should not see all 
-                && $env{'user.domain'}  eq 'public';   ##links
+                && $public;                            ##who should not see all 
+                                                       ##links
         next if    $$menuitem[4]        eq 'onlypublic'# hide links which are 
-                && $env{'user.name'}    ne 'public'    # only visible to public
-                && $env{'user.domain'}  ne 'public';   # users
+                && !$public;                           # only visible to public
+                                                       # users
         next if    $$menuitem[4]        eq 'gci'
                 && (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});
         next if    $$menuitem[4]        eq 'home'