--- loncom/interface/loncreateuser.pm 2003/12/10 20:38:09 1.72 +++ loncom/interface/loncreateuser.pm 2006/05/30 12:46:09 1.118 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.72 2003/12/10 20:38:09 sakharuk Exp $ +# $Id: loncreateuser.pm,v 1.118 2006/05/30 12:46:09 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,9 @@ use Apache::Constants qw(:common :http); use Apache::lonnet; use Apache::loncommon; use Apache::lonlocal; +use Apache::longroup; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; my $loginscript; # piece of javascript used in two separate instances my $generalrule; @@ -73,10 +76,9 @@ my $authformint; my $authformfsys; my $authformloc; -BEGIN { - $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/; - my $krbdefdom=$1; - $krbdefdom=~tr/a-z/A-Z/; +sub initialize_authen_forms { + my ($krbdefdom)=( $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/); + $krbdefdom= uc($krbdefdom); my %param = ( formname => 'document.cu', kerb_def_dom => $krbdefdom ); @@ -109,23 +111,23 @@ 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; } # =================================================================== Phase one sub print_username_entry_form { - my $r=shift; - my $defdom=$ENV{'request.role.domain'}; + my ($r) = @_; + 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 $start_page = + &Apache::loncommon::start_page('Create Users, Change User Privileges', + $selscript); + my $sellink=&Apache::loncommon::selectstudent_link ('crtuser','ccuname','ccdomain'); my %existingroles=&my_custom_roles(); @@ -140,16 +142,14 @@ sub print_username_entry_form { 'nr' => "Name of Role", 'cre' => "Custom Role Editor" ); + my $help = &Apache::loncommon::help_open_menu('',undef,undef,'',282,'Instructor Interface'); + my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); + my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); $r->print(<<"ENDDOCUMENT"); - -
-