[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Sun, 06 Jul 2003 10:30:22 -0000
www Sun Jul 6 06:30:22 2003 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
Partly rewinding 1.385: random instructors should not be able to remove
first and last name of a student simply by not specifying them - every user
presumably at all times should have a first and a last name.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.387 loncom/lonnet/perl/lonnet.pm:1.388
--- loncom/lonnet/perl/lonnet.pm:1.387 Sat Jul 5 06:07:11 2003
+++ loncom/lonnet/perl/lonnet.pm Sun Jul 6 06:30:21 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.387 2003/07/05 10:07:11 www Exp $
+# $Id: lonnet.pm,v 1.388 2003/07/06 10:30:21 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2801,13 +2801,16 @@
} else {
%names = @tmp;
}
-
- if (defined($first)) { $names{'firstname'} = $first; }
+#
+# Make sure to not trash student environment if instructor does not bother
+# to supply name and email information
+#
+ if ($first) { $names{'firstname'} = $first; }
if (defined($middle)) { $names{'middlename'} = $middle; }
- if (defined($last)) { $names{'lastname'} = $last; }
+ if ($last) { $names{'lastname'} = $last; }
if (defined($gene)) { $names{'generation'} = $gene; }
- if (defined($email)) { $names{'notification'} = $email;
- $names{'critnotification'} = $email; }
+ if ($email) { $names{'notification'} = $email;
+ $names{'critnotification'} = $email; }
my $reply = &put('environment', \%names, $udom,$uname);
if ($reply ne 'ok') { return 'error: '.$reply; }