--- loncom/interface/lonuserutils.pm 2010/09/26 01:57:21 1.127
+++ loncom/interface/lonuserutils.pm 2010/11/01 18:01:26 1.128
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.127 2010/09/26 01:57:21 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.128 2010/11/01 18:01:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3972,6 +3972,7 @@ sub upfile_drop_add {
my @secs;
my %entries=&Apache::loncommon::record_sep($line);
# Determine user name
+ $entries{$fields{'username'}} =~ s/^\s+|\s+$//g;
unless (($entries{$fields{'username'}} eq '') ||
(!defined($entries{$fields{'username'}}))) {
my ($fname, $mname, $lname,$gen) = ('','','','');
@@ -3992,11 +3993,17 @@ sub upfile_drop_add {
$gen=$entries{$fields{'gen'}};
}
}
+
if ($entries{$fields{'username'}}
ne &LONCAPA::clean_username($entries{$fields{'username'}})) {
+ my $nowhitespace;
+ if ($entries{$fields{'username'}} =~ /\s/) {
+ $nowhitespace = ' - '.&mt('usernames may not contain spaces.');
+ }
$r->print('
'.
&mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]',
- ''.$entries{$fields{'username'}}.'',$fname,$mname,$lname,$gen));
+ ''.$entries{$fields{'username'}}.'',$fname,$mname,$lname,$gen).
+ $nowhitespace);
next;
} else {
if ($entries{$fields{'domain'}}