--- loncom/interface/loncreateuser.pm 2011/09/25 23:07:49 1.358 +++ loncom/interface/loncreateuser.pm 2012/02/06 04:50:52 1.358.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.358 2011/09/25 23:07:49 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.358.4.1 2012/02/06 04:50:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -674,7 +674,7 @@ $userpicker ENDBLOCK if ($env{'form.phase'} eq '') { my $defdom=$env{'request.role.domain'}; - my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); + my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain','',1); my %lt=&Apache::lonlocal::texthash( 'enro' => 'Enroll one student', 'enrm' => 'Enroll one member', @@ -723,7 +723,7 @@ $showresponse - + @@ -938,12 +938,18 @@ sub print_user_modification_page { my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules); my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); if ($uhome eq 'no_host') { - my $usertype; + my $lc_ccuname = lc($ccuname); + if ($lc_ccuname ne $ccuname) { + $uhome = &Apache::lonnet::homeserver($lc_ccuname,$ccdomain); + $ccuname = $lc_ccuname; + } + } + if ($uhome eq 'no_host') { my ($rules,$ruleorder) = &Apache::lonnet::inst_userrules($ccdomain,'username'); - $usertype = - &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules, - \%curr_rules,\%got_rules); + my $usertype = + &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules, + \%curr_rules,\%got_rules); my $cancreate = &Apache::lonuserutils::can_create_user($ccdomain,$context, $usertype); @@ -4100,7 +4106,9 @@ sub handler { if ($env{'form.phase'} eq 'createnewuser') { my $response; if ($env{'form.srchterm'} !~ /^$match_username$/) { - my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); + my $response = '

'. + &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'). + '

'; $env{'form.phase'} = ''; &print_username_entry_form($r,$context,$response,$srch,undef,$crstype,$brcrum); } else { @@ -5614,7 +5622,9 @@ sub user_search_result { if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) { if (($srch->{'srchdomain'} eq '') || ! (&Apache::lonnet::domain($srch->{'srchdomain'}))) { - $response = &mt('You must specify a valid domain when searching in a domain or institutional directory.') + $response = '

'. + &mt('You must specify a valid domain when searching in a domain or institutional directory.'). + '

'; } } if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') || @@ -5627,7 +5637,9 @@ sub user_search_result { } } if ($unamecheck !~ /^$match_username$/) { - $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); + $response = '

'. + &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'). + '

'; } } } @@ -5802,7 +5814,8 @@ sub user_search_result { ($currstate,$response,$forcenewuser) = &build_search_response($context,$srch,%srch_results); } else { - my $showdom = &display_domain_info($srch->{'srchdomain'}); $response = ''. + my $showdom = &display_domain_info($srch->{'srchdomain'}); + $response = ''. &mt('Institutional directory search is not available in domain: [_1]',$showdom). '
'. &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').
$lt{'usr'}:  $lt{'dom'}:$domform  $sellink