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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 15 Nov 2005 15:40:58 -0000


albertel		Tue Nov 15 10:40:58 2005 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - trying to prevent the creation of another plainname
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.288 loncom/interface/loncommon.pm:1.289
--- loncom/interface/loncommon.pm:1.288	Tue Nov 15 10:14:17 2005
+++ loncom/interface/loncommon.pm	Tue Nov 15 10:40:58 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.288 2005/11/15 15:14:17 raeburn Exp $
+# $Id: loncommon.pm,v 1.289 2005/11/15 15:40:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2775,8 +2775,8 @@
 h1, h2, h3, th { font-family: Arial, Helvetica, sans-serif }
 a:focus { color: red; background: yellow } 
 table.thinborder { border-collapse: collapse; }
-table.thinborder tr th { border-style: solid; border-width: 1px}
-table.thinborder tr td { border-style: solid; border-width: 1px}
+table.thinborder tr th, table.thinborder tr td { border-style: solid; border-width: 1px}
+form, .inline { display: inline; }
 .center { text-align: center; }
 </style>
 <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"
@@ -3211,19 +3211,10 @@
 
 sub get_user_info {
     my ($udom,$uname,$idx,$userdata) = @_;
-    my %userinfo = &Apache::lonnet::get('environment',['firstname','middlename','lastname','generation','id'],$udom,$uname);
-    if (grep/^(con_lost|error|no_such_host)/,keys(%userinfo)) {
-        &Apache::lonnet::logthis('get_user_info error for '.$uname.':'.$udom);
-        $$userdata{$uname.':'.$udom}[$$idx{udom}] = $udom;
-        $$userdata{$uname.':'.$udom}[$$idx{uname}] = $uname; 
-    } else {
-        $userinfo{fullname} = &Apache::lonnet::format_name(@userinfo{qw/firstname middlename lastname generation/},'lastname');
-        $userinfo{uname} = $uname;
-        $userinfo{udom} = $udom;
-        foreach my $item (qw/uname udom id fullname/) {
-            $$userdata{$uname.':'.$udom}[$$idx{$item}] = $userinfo{$item};
-        }
-    }
+    $$userdata{$uname.':'.$udom}[$$idx{fullname}] = 
+	&plainname($uname,$udom,'lastname');
+    $$userdata{$uname.':'.$udom}[$$idx{uname}] = $uname
+    $$userdata{$uname.':'.$udom}[$$idx{uname}] = $udom
     return;
 }