--- loncom/lonnet/perl/lonnet.pm 2010/03/26 21:27:41 1.1056.2.2 +++ loncom/lonnet/perl/lonnet.pm 2010/05/18 04:22:00 1.1056.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1056.2.2 2010/03/26 21:27:41 raeburn Exp $ +# $Id: lonnet.pm,v 1.1056.4.1 2010/05/18 04:22:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6535,7 +6535,7 @@ sub modifyuser { } &logthis('Call to modify user '.$udom.', '.$uname.', '.$uid.', '. $umode.', '.$first.', '.$middle.', '. - $last.', '.$gene.'(forceid: '.$forceid.'; candelete: '.$showcandelete.')'. + $last.', '.$gene.'(forceid: '.$forceid.'; candelete: '.$showcandelete.')'. (defined($desiredhome) ? ' desiredhome = '.$desiredhome : ' desiredhome not specified'). ' by '.$env{'user.name'}.' at '.$env{'user.domain'}. @@ -6599,11 +6599,11 @@ sub modifyuser { } else { %names = @tmp; } -# # If name, email and/or uid are blank (e.g., because an uploaded file # of users did not contain them), do not overwrite existing values -# unless field is in $candelete array ref. +# unless field is in $candelete array ref. # + my @fields = ('firstname','middlename','lastname','generation', 'permanentemail','id'); my %newvalues; @@ -6616,7 +6616,7 @@ sub modifyuser { $names{$field} = $middle; } elsif ($field eq 'lastname') { $names{$field} = $last; - } elsif ($field eq 'generation') { + } elsif ($field eq 'generation') { $names{$field} = $gene; } elsif ($field eq 'permanentemail') { $names{$field} = $email; @@ -6626,7 +6626,6 @@ sub modifyuser { } } } - if ($first) { $names{'firstname'} = $first; } if (defined($middle)) { $names{'middlename'} = $middle; } if ($last) { $names{'lastname'} = $last; } @@ -10359,7 +10358,7 @@ modifyuser($udom,$uname,$uid,$umode,$upa will update user information (firstname,middlename,lastname,generation, permanentemail), and if forceid is true, student/employee ID also. A user's institutional affiliation(s) can also be updated. -User information fields will not be overwritten with empty entries +User information fields will not be overwritten with empty entries unless the field is included in the $candelete array reference. This array is included when a single user is modified via "Manage Users", or when Autoupdate.pl is run by cron in a domain.