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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 19 Jul 2006 10:58:31 -0000


albertel		Wed Jul 19 06:58:31 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - getting rid of role info in public mode
  - giving public:public the name 'Public'
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.432 loncom/interface/loncommon.pm:1.433
--- loncom/interface/loncommon.pm:1.432	Wed Jul 19 06:52:27 2006
+++ loncom/interface/loncommon.pm	Wed Jul 19 06:58:31 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.432 2006/07/19 10:52:27 albertel Exp $
+# $Id: loncommon.pm,v 1.433 2006/07/19 10:58:31 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2048,6 +2048,9 @@
 
 sub getnames {
     my ($uname,$udom)=@_;
+    if ($udom eq 'public' && $uname eq 'public') {
+	return ('lastname' => &mt('Public'));
+    }
     my $id=$uname.':'.$udom;
     my ($names,$cached)=&Apache::lonnet::is_cached_new('namescache',$id);
     if ($cached) {
@@ -2885,6 +2888,7 @@
     } else {
         $role = &Apache::lonnet::plaintext($role);
     }
+
     if (!$realm) { $realm=' '; }
 # Set messages
     my $messages=&domainlogo($domain);
@@ -2913,6 +2917,9 @@
     }
 
     my $name = &plainname($env{'user.name'},$env{'user.domain'});
+    if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
+	undef($role);
+    }
     
     my $roleinfo=(<<ENDROLE);
 <td class="LC_title_bar_who">