--- loncom/interface/loncreateuser.pm 2007/07/30 00:31:27 1.162 +++ loncom/interface/loncreateuser.pm 2007/08/02 01:00:32 1.165 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.162 2007/07/30 00:31:27 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.165 2007/08/02 01:00:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -204,7 +204,7 @@ sub print_username_entry_form { my ($jsback,$elements) = &crumb_utilities(); my $jscript = &Apache::loncommon::studentbrowser_javascript()."\n". - ''."\n"; @@ -1307,15 +1307,13 @@ sub update_user_data { $r->print($error.&mt('Invalid login mode or password').$end); return; } + + + $r->print('
'.&mt('Create/Modify Another User').'
'); $r->print(''."\n"); foreach my $item ('srchby','srchin','srchtype','srchterm','srchdomain','ccuname','ccdomain') { $r->print(''."\n"); @@ -2136,7 +2122,6 @@ sub handler { if ($env{'form.phase'} eq 'get_user_info') { my ($state,$response,$forcenewuser,$results) = &user_search_result($srch); - print STDERR "Got $state,$response,$forcenewuser\n"; if ($state eq 'select') { &print_user_selection_page($r,$response,$srch,$results); } elsif ($state eq 'modify') { @@ -2183,7 +2168,6 @@ sub handler { #-------------------------------------------------- functions for &phase_two sub user_search_result { my ($srch) = @_; - my @alldomains = sort(&Apache::lonnet::all_domains()); my %allhomes; my %inst_matches; my %srch_results; @@ -2203,7 +2187,7 @@ sub user_search_result { } if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) { if (($srch->{'srchdomain'} eq '') || - (!(grep/^\Q$srch->{'srchdomain'}\E$/,@alldomains))) { + ! (&Apache::lonnet::domain($srch->{'srchdomain'}))) { $response = &mt('You must specify a valid domain when searching in a domain or institutional directory.') } } @@ -2220,7 +2204,7 @@ sub user_search_result { } } if ($response ne '') { - return ($state,$response); + return ($state,''.$response.''); } if ($srch->{'srchby'} eq 'uname') { if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs')) { @@ -2345,11 +2329,11 @@ sub directorysrch_check { ['directorysrch'],$srch->{'srchdomain'}); if (ref($dom_inst_srch{'directorysrch'}) eq 'HASH') { if (!$dom_inst_srch{'directorysrch'}{'available'}) { - return &mt('Directory search unavailable in domain: [_1]',$srch->{'srchdomain'}); + return &mt('Institutional directory search unavailable in domain: [_1]',$srch->{'srchdomain'}); } if ($dom_inst_srch{'directorysrch'}{'localonly'}) { if ($env{'request.role.domain'} ne $srch->{'srchdomain'}) { - return &mt('Directory search in domain: [_1] is only allowed for users with a current role in the domain.',$srch->{'srchdomain'}); + return &mt('Insitutional directory search in domain: [_1] is only allowed for users with a current role in the domain.',$srch->{'srchdomain'}); } my @usertypes = split(/:/,$env{'environment.inststatus'}); if (!@usertypes) { @@ -2445,7 +2429,7 @@ sub build_search_response { $state = 'modify'; $response = &mt("$single{$srch->{'srchtype'}} was found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); } else { - $response = &mt("$nomatch{$srch->{'srchtype'}} found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); + $response = ''.&mt("$nomatch{$srch->{'srchtype'}} found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}).''; if ($srch->{'srchin'} ne 'alc') { $forcenewuser = 1; my $cansrchinst = 0; @@ -2467,7 +2451,7 @@ sub build_search_response { } } } - $response .= '