--- loncom/interface/loncreateuser.pm 2002/04/23 21:05:45 1.33 +++ loncom/interface/loncreateuser.pm 2003/02/03 18:03:52 1.47 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.33 2002/04/23 21:05:45 matthew Exp $ +# $Id: loncreateuser.pm,v 1.47 2003/02/03 18:03:52 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,10 +44,9 @@ # 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer # April Guy Albertelli # 05/10,10/16 Gerd Kortemeyer -# 11/12,11/13,11/15 Scott Harrison # 02/11/02 Matthew Hall # -# $Id: loncreateuser.pm,v 1.33 2002/04/23 21:05:45 matthew Exp $ +# $Id: loncreateuser.pm,v 1.47 2003/02/03 18:03:52 harris41 Exp $ ### package Apache::loncreateuser; @@ -80,27 +79,48 @@ 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'); + my $selscript=&Apache::loncommon::studentbrowser_javascript(); + my $sellink=&Apache::loncommon::selectstudent_link + ('crtuser','ccuname','ccdomain'); $r->print(<<"ENDDOCUMENT");