--- loncom/interface/loncreateuser.pm 2003/03/23 09:06:08 1.51 +++ loncom/interface/loncreateuser.pm 2003/07/17 19:40:39 1.59 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.51 2003/03/23 09:06:08 albertel Exp $ +# $Id: loncreateuser.pm,v 1.59 2003/07/17 19:40:39 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,7 @@ # 05/10,10/16 Gerd Kortemeyer # 02/11/02 Matthew Hall # -# $Id: loncreateuser.pm,v 1.51 2003/03/23 09:06:08 albertel Exp $ +# $Id: loncreateuser.pm,v 1.59 2003/07/17 19:40:39 www Exp $ ### package Apache::loncreateuser; @@ -54,6 +54,7 @@ package Apache::loncreateuser; use strict; use Apache::Constants qw(:common :http); use Apache::lonnet; +use Apache::loncommon; my $loginscript; # piece of javascript used in two separate instances my $generalrule; @@ -82,6 +83,18 @@ BEGIN { } +# ======================================================= Existing Custom Roles + +sub my_custom_roles { + my %returnhash=(); + my %rolehash=&Apache::lonnet::dump('roles'); + foreach (keys %rolehash) { + if ($_=~/^rolesdef\_(\w+)$/) { + $returnhash{$_}=$_; + } + } + return %returnhash; +} # ==================================================== Figure out author access @@ -106,6 +119,9 @@ sub print_username_entry_form { 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)); $r->print(<<"ENDDOCUMENT");
@@ -115,15 +131,19 @@ $selscript $bodytag +