--- loncom/interface/loncreateuser.pm 2002/06/05 18:11:15 1.36 +++ loncom/interface/loncreateuser.pm 2002/11/18 20:06:53 1.44 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.36 2002/06/05 18:11:15 matthew Exp $ +# $Id: loncreateuser.pm,v 1.44 2002/11/18 20:06:53 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,7 +47,7 @@ # 11/12,11/13,11/15 Scott Harrison # 02/11/02 Matthew Hall # -# $Id: loncreateuser.pm,v 1.36 2002/06/05 18:11:15 matthew Exp $ +# $Id: loncreateuser.pm,v 1.44 2002/11/18 20:06:53 matthew Exp $ ### package Apache::loncreateuser; @@ -80,27 +80,44 @@ BEGIN { $authformloc = &Apache::loncommon::authform_local(%param); } + + +# ==================================================== Figure out author access + +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 ''; } + return 1; +} + # =================================================================== Phase one -sub phase_one { +sub print_username_entry_form { my $r=shift; - my $defdom=$ENV{'user.domain'}; + my $defdom=$ENV{'request.role.domain'}; my @domains = &Apache::loncommon::get_domains(); my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain'); + my $bodytag =&Apache::loncommon::bodytag( + 'Create Users, Change User Privileges'); $r->print(<<"ENDDOCUMENT");