--- loncom/enrollment/Autoupdate.pl 2009/02/01 20:10:26 1.12 +++ loncom/enrollment/Autoupdate.pl 2009/09/06 02:11:46 1.14 @@ -1,7 +1,7 @@ #!/usr/bin/perl # # Automated Userinfo update script -# $Id: Autoupdate.pl,v 1.12 2009/02/01 20:10:26 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 @@ -82,7 +82,7 @@ (my $insttypechg,@inststatuses) = &affiliations_check(\%userhash,$instusers{$uname}); if ($insttypechg) { - my $inststatusstr = join(':',&escape(@inststatuses)); + my $inststatusstr = join(':',map { &escape($_) } (@inststatuses)); my %statushash = ( inststatus => $inststatusstr ); my $statusres = &Apache::lonnet::put('environment',\%statushash,$dom,$uname); } @@ -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}; }