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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 14 Dec 2007 17:35:53 -0000


raeburn		Fri Dec 14 12:35:53 2007 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  lonnet::get_instuser returns a hash of a hash.
  Pass the inst_results{user} hash for the specific user to &personal_data_display(), instead of %inst_results.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.209 loncom/interface/loncreateuser.pm:1.210
--- loncom/interface/loncreateuser.pm:1.209	Thu Dec 13 19:20:53 2007
+++ loncom/interface/loncreateuser.pm	Fri Dec 14 12:35:52 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.209 2007/12/14 00:20:53 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.210 2007/12/14 17:35:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -738,8 +738,8 @@
 ENDTITLE
         $r->print('<div class="LC_left_float">');
         my $personal_table = 
-            &personal_data_display($ccuname,$ccdomain,$newuser,
-                                   $context,%inst_results);
+            &personal_data_display($ccuname,$ccdomain,$newuser,$context,
+                                   $inst_results{$ccuname.':'.$ccdomain});
         $r->print($personal_table);
         my ($home_server_pick,$numlib) = 
             &Apache::loncommon::home_server_form_item($ccdomain,'hserver',
@@ -819,8 +819,8 @@
 ENDCHANGEUSER
         $r->print('<div class="LC_left_float">');
         my ($personal_table,$showforceid) = 
-            &personal_data_display($ccuname,$ccdomain,$newuser,
-                                   $context,%inst_results);
+            &personal_data_display($ccuname,$ccdomain,$newuser,$context,
+                                   $inst_results{$ccuname.':'.$ccdomain});
         $r->print($personal_table);
         if ($showforceid) {
             $r->print(&Apache::lonuserutils::forceid_change($context));
@@ -1353,7 +1353,7 @@
 }
 
 sub personal_data_display {
-    my ($ccuname,$ccdomain,$newuser,$context,%inst_results) = @_; 
+    my ($ccuname,$ccdomain,$newuser,$context,$inst_results) = @_;
     my ($output,$showforceid,%userenv,%domconfig);
     if (!$newuser) {
         # Get the users information
@@ -1394,8 +1394,12 @@
         }
         $output .= &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
         if ($newuser) {
-            if ($inst_results{$item} ne '') {
-                $output .= '<input type="hidden" name="c'.$item.'" value="'.$inst_results{$item}.'" />'.$inst_results{$item};
+            if (ref($inst_results) eq 'HASH') {
+                if ($inst_results->{$item} ne '') {
+                    $output .= '<input type="hidden" name="c'.$item.'" value="'.$inst_results->{$item}.'" />'.$inst_results->{$item};
+                } else {
+                    $output .= '<input type="text" name="c'.$item.'" size="'.$textboxsize{$item}.'" value="" />';
+                }
             } else {
                 $output .= '<input type="text" name="c'.$item.'" size="'.$textboxsize{$item}.'" value="" />';
             }