--- loncom/interface/loncreateuser.pm 2011/01/05 18:42:53 1.353 +++ 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.353 2011/01/05 18:42:53 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
$lt{'usr'}: | -+ | $lt{'dom'}: | $domform | $sellink | @@ -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); @@ -1322,7 +1328,7 @@ ENDNOTOOLSPRIV $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain); } if ($context eq 'domain') { - my $add_domainroles = &new_domain_roles($r); + my $add_domainroles = &new_domain_roles($r,$ccdomain); if (!$addrolesdisplay) { $addrolesdisplay = $add_domainroles; } @@ -1765,7 +1771,7 @@ sub new_coauthor_roles { } sub new_domain_roles { - my ($r) = @_; + my ($r,$ccdomain) = @_; my $addrolesdisplay = 0; # # Domain level @@ -1783,6 +1789,7 @@ sub new_domain_roles { foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) { foreach my $role (@allroles) { next if ($role eq 'ad'); + next if (($role eq 'au') && ($ccdomain ne $thisdomain)); if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) { my $plrole=&Apache::lonnet::plaintext($role); my %lt=&Apache::lonlocal::texthash( @@ -4041,6 +4048,10 @@ sub handler { my ($permission,$allowed) = &Apache::lonuserutils::get_permission($context,$crstype); if (!$allowed) { + if ($context eq 'course') { + $r->internal_redirect('/adm/viewclasslist'); + return OK; + } $env{'user.error.msg'}= "/adm/createuser:cst:0:0:Cannot create/modify user data ". "or view user status."; @@ -4095,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 = ' | '.$courseform.' | '.$lt{'rol'}.' | '.$lt{'grs'}.' | '.$lt{'sta'}.' | '.$lt{'end'}.' | '. + ''.$lt{'scc'}.' | '.$lt{'rol'}.' | '.$lt{'grs'}.' | '.$lt{'sta'}.' | '.$lt{'end'}.' | '. &Apache::loncommon::end_data_table_header_row(); my $otheritems = &Apache::loncommon::start_data_table_row()."\n". - ''. + $courseform.(' ' x4).' | '."\n".
'
---|