--- loncom/interface/loncreateuser.pm 2007/08/31 17:58:47 1.182 +++ loncom/interface/loncreateuser.pm 2007/09/07 19:51:41 1.183 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.182 2007/08/31 17:58:47 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.183 2007/09/07 19:51:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2214,9 +2214,7 @@ sub user_search_result { my %inst_matches; my %srch_results; my ($response,$currstate,$forcenewuser,$dirsrchres); - $srch->{'srchterm'} =~ s/^\s+//; - $srch->{'srchterm'} =~ s/\s+$//; - + $srch->{'srchterm'} =~ s/\s+/ /g; if ($srch->{'srchby'} !~ /^(uname|lastname|lastfirst)$/) { $response = &mt('Invalid search.'); } @@ -2229,6 +2227,9 @@ sub user_search_result { if ($srch->{'srchterm'} eq '') { $response = &mt('You must enter a search term.'); } + if ($srch->{'srchterm'} =~ /^\s+$/) { + $response = &mt('Your search term must contain more than just spaces.'); + } if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) { if (($srch->{'srchdomain'} eq '') || ! (&Apache::lonnet::domain($srch->{'srchdomain'}))) {