--- loncom/enrollment/Autoupdate.pl 2009/02/01 20:10:26 1.12 +++ loncom/enrollment/Autoupdate.pl 2010/03/21 20:39:30 1.15 @@ -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.15 2010/03/21 20:39:30 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); } @@ -112,7 +112,7 @@ if ($settings->{'classlists'} == 1) { if ($field eq 'id') { $changes{'id'} = 1; - } elsif ($field eq 'lastname' || $field eq 'firstname' || $field eq 'middlename' || $field eq 'gen') { + } elsif ($field eq 'lastname' || $field eq 'firstname' || $field eq 'middlename' || $field eq 'generation') { $changes{'fullname'} = 1; } } @@ -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}; }