--- loncom/interface/loncreateuser.pm 2007/07/30 00:31:27 1.162 +++ loncom/interface/loncreateuser.pm 2007/07/30 22:44:04 1.163 @@ -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.163 2007/07/30 22:44:04 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1755,7 +1755,7 @@ END } # End of foreach (keys(%env)) # Flush the course logs so reverse user roles immediately updated &Apache::lonnet::flushcourselogs(); - $r->print('

Create/Modify Another User

'); + $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 +2136,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 +2182,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 +2201,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 +2218,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 +2343,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 +2443,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 +2465,7 @@ sub build_search_response { } } } - $response .= '
'.&mt("To add as a new user:").''.&mt("Note: you can only create new users in the domain of your current role -".$env{'request.role.domain'}).'

'; + $response .= '
'.&mt("To add as a new user:").''.&mt("Note: you can only create new users in the domain of your current role - [_1]",$env{'request.role.domain'}).'

'; } } }