--- loncom/interface/loncreateuser.pm 2003/10/18 16:06:47 1.70 +++ loncom/interface/loncreateuser.pm 2005/06/06 00:06:12 1.102 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.70 2003/10/18 16:06:47 www Exp $ +# $Id: loncreateuser.pm,v 1.102 2005/06/06 00:06:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,10 +73,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,9 +108,9 @@ 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 ''; } + 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; } @@ -120,19 +119,30 @@ 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 $bodytag =&Apache::loncommon::bodytag( - 'Create Users, Change User Privileges'); + 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 ('crtuser','ccuname','ccdomain'); my %existingroles=&my_custom_roles(); my $choice=&Apache::loncommon::select_form('make new role','rolename', ('make new role' => 'Generate new role ...',%existingroles)); + my %lt=&Apache::lonlocal::texthash( + 'siur' => "Set Individual User Roles", + 'usr' => "Username", + 'dom' => "Domain", + 'usrr' => "User Roles", + 'ecrp' => "Edit Custom Role Privileges", + 'nr' => "Name of Role", + 'cre' => "Custom Role Editor" + ); + 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