[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Thu, 06 Aug 2009 04:54:23 -0000


raeburn		Thu Aug  6 04:54:23 2009 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Eliminate retrieval of user environment for users who do not yet exist.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1008 loncom/lonnet/perl/lonnet.pm:1.1009
--- loncom/lonnet/perl/lonnet.pm:1.1008	Fri Jul 31 02:20:17 2009
+++ loncom/lonnet/perl/lonnet.pm	Thu Aug  6 04:54:23 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1008 2009/07/31 02:20:17 raeburn Exp $
+# $Id: lonnet.pm,v 1.1009 2009/08/06 04:54:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1665,12 +1665,14 @@
     }
     $items=~s/\&$//;
     my %returnhash=();
-    my @answer=split(/\&/,
-                &reply('get:'.$udom.':'.$unam.':environment:'.$items,
-                      &homeserver($unam,$udom)));
-    my $i;
-    for ($i=0;$i<=$#what;$i++) {
-	$returnhash{$what[$i]}=&unescape($answer[$i]);
+    my $uhome = &homeserver($unam,$udom);
+    unless ($uhome eq 'no_host') {
+        my @answer=split(/\&/, 
+            &reply('get:'.$udom.':'.$unam.':environment:'.$items,$uhome));
+        my $i;
+        for ($i=0;$i<=$#what;$i++) {
+	    $returnhash{$what[$i]}=&unescape($answer[$i]);
+        }
     }
     return %returnhash;
 }