[LON-CAPA-cvs] cvs: loncom /enrollment Autoupdate.pl

raeburn raeburn@source.lon-capa.org
Sun, 06 Sep 2009 02:11:46 -0000


raeburn		Sun Sep  6 02:11:46 2009 EDT

  Modified files:              
    /loncom/enrollment	Autoupdate.pl 
  Log:
  - middlename and generation can be modified by Autoupdate.pl
  - provide existing values for user information in fields which are not modifiable
     in call to lonnet::modifyuser() to future proof against removal of existing safeguards 
     in that routine.
  
  
Index: loncom/enrollment/Autoupdate.pl
diff -u loncom/enrollment/Autoupdate.pl:1.13 loncom/enrollment/Autoupdate.pl:1.14
--- loncom/enrollment/Autoupdate.pl:1.13	Mon Mar  9 05:25:49 2009
+++ loncom/enrollment/Autoupdate.pl	Sun Sep  6 02:11:46 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 #
 # Automated Userinfo update script
-# $Id: Autoupdate.pl,v 1.13 2009/03/09 05:25:49 raeburn Exp $
+# $Id: Autoupdate.pl,v 1.14 2009/09/06 02:11:46 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,7 +42,7 @@
         exit;
     }
     my @info = ('inststatus','lockedname','internalname','lastname',
-                'firstname','id','permanentemail');
+                'firstname','middlename','generation','id','permanentemail');
     # Initialize language handler
     &Apache::lonlocal::get_language_handle();
     # find out which users we need to examine
@@ -121,6 +121,10 @@
                     # Make the change
                     if ($changed) {
                         my %userupdate;
+                        foreach my $item ('lastname','firstname','middlename','generation','id',
+                                          'permanentemail') {
+                            $userupdate{$item} = $userhash{$item};
+                        }
                         foreach my $field (@fields) {
                             $userupdate{$field} = $instusers{$uname}{$field};
                         }