--- loncom/interface/loncreateuser.pm 2005/01/11 22:12:22 1.98 +++ loncom/interface/loncreateuser.pm 2005/06/19 00:41:32 1.105 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.98 2005/01/11 22:12:22 albertel Exp $ +# $Id: loncreateuser.pm,v 1.105 2005/06/19 00:41:32 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,10 +108,8 @@ sub my_custom_roles { sub authorpriv { my ($auname,$audom)=@_; - if (($auname ne $ENV{'user.name'}) || - (($audom ne $ENV{'user.domain'}) && - ($audom ne $ENV{'request.role.domain'}))) { return ''; } - unless (&Apache::lonnet::allowed('cca',$audom)) { return ''; } + unless ((&Apache::lonnet::allowed('cca',$audom.'/'.$auname)) + || (&Apache::lonnet::allowed('caa',$audom.'/'.$auname))) { return ''; } return 1; } @@ -119,9 +117,10 @@ sub authorpriv { sub print_username_entry_form { my $r=shift; - my $defdom=$ENV{'request.role.domain'}; + my $defdom=$env{'request.role.domain'}; my @domains = &Apache::loncommon::get_domains(); my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain'); + my $html=&Apache::lonxml::xmlbegin(); my $bodytag =&Apache::loncommon::bodytag('Create Users, Change User Privileges').&Apache::loncommon::help_open_menu('',undef,undef,'',282,'Instructor Interface'); my $selscript=&Apache::loncommon::studentbrowser_javascript(); my $sellink=&Apache::loncommon::selectstudent_link @@ -141,7 +140,7 @@ sub print_username_entry_form { my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); $r->print(<<"ENDDOCUMENT"); - +$html The LearningOnline Network with CAPA $selscript @@ -170,8 +169,8 @@ ENDDOCUMENT # =================================================================== Phase two sub print_user_modification_page { my $r=shift; - my $ccuname=$ENV{'form.ccuname'}; - my $ccdomain=$ENV{'form.ccdomain'}; + my $ccuname=$env{'form.ccuname'}; + my $ccdomain=$env{'form.ccdomain'}; $ccuname=~s/\W//g; $ccdomain=~s/\W//g; @@ -181,7 +180,7 @@ sub print_user_modification_page { return; } - my $defdom=$ENV{'request.role.domain'}; + my $defdom=$env{'request.role.domain'}; my ($krbdef,$krbdefdom) = &Apache::loncommon::get_kerberos_defaults($defdom); @@ -198,7 +197,7 @@ sub print_user_modification_page { my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); my $dc_setcourse_code = ''; my $loaditem; - if ($ENV{'request.role'} =~ m-^dc\./(\w+)/$-) { + if ($env{'request.role'} =~ m-^dc\./(\w+)/$-) { my $dcdom = $1; $loaditem = qq|OnLoad="document.cu.coursedesc.value=''"|; $dc_setcourse_code = <<"ENDSCRIPT"; @@ -271,8 +270,9 @@ sub print_user_modification_page { } ENDSCRIPT } + my $html=&Apache::lonxml::xmlbegin(); my $dochead =<<"ENDDOCHEAD"; - +$html The LearningOnline Network with CAPA