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

raeburn raeburn@source.lon-capa.org
Tue, 30 Nov 2010 06:28:18 -0000


raeburn		Tue Nov 30 06:28:18 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	loncommon.pm 
  Log:
  - Customization for GCI_3
    - Backport 1.954.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.925.2.18 loncom/interface/loncommon.pm:1.925.2.19
--- loncom/interface/loncommon.pm:1.925.2.18	Tue Nov  9 03:20:32 2010
+++ loncom/interface/loncommon.pm	Tue Nov 30 06:28:17 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.925.2.18 2010/11/09 03:20:32 raeburn Exp $
+# $Id: loncommon.pm,v 1.925.2.19 2010/11/30 06:28:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4463,6 +4463,11 @@
     my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
         $no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
 
+    my $public;
+    if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
+        || ($env{'user.name'} eq '') && ($env{'user.domain'} eq '')) {
+        $public = 1;
+    }
     if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
 
     $function = &get_users_function() if (!$function);
@@ -4528,7 +4533,7 @@
     } 
 
     my $name = &plainname($env{'user.name'},$env{'user.domain'});
-    if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
+    if ($public) {
 	undef($role);
     } else {
 	$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
@@ -4549,7 +4554,7 @@
     $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
     &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
 
-    if ($env{'environment.remote'} eq 'off') {
+    if ($env{'environment.remote'} ne 'on') {
         # No Remote
         if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { 
             return $bodytag; 
@@ -4658,7 +4663,7 @@
         }
 
         #don't show menus for public users
-        if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
+        if(!$public){
             if (($custommenu) && 
                 ($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) {
                 $bodytag .= &Apache::lonmenu::gci_secondary_menu();