--- loncom/interface/loncreateuser.pm 2003/07/17 18:10:53 1.57 +++ loncom/interface/loncreateuser.pm 2003/07/19 00:51:05 1.63 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.57 2003/07/17 18:10:53 matthew Exp $ +# $Id: loncreateuser.pm,v 1.63 2003/07/19 00:51:05 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,28 +25,6 @@ # # http://www.lon-capa.org/ # -# (Create a course -# (My Desk -# -# (Internal Server Error Handler -# -# (Login Screen -# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, -# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer) -# -# YEAR=2001 -# 3/1/1 Gerd Kortemeyer) -# -# 3/1 Gerd Kortemeyer) -# -# 2/14 Gerd Kortemeyer) -# -# 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 -# 02/11/02 Matthew Hall -# -# $Id: loncreateuser.pm,v 1.57 2003/07/17 18:10:53 matthew Exp $ ### package Apache::loncreateuser; @@ -83,6 +61,18 @@ BEGIN { } +# ======================================================= Existing Custom Roles + +sub my_custom_roles { + my %returnhash=(); + my %rolehash=&Apache::lonnet::dump('roles'); + foreach (keys %rolehash) { + if ($_=~/^rolesdef\_(\w+)$/) { + $returnhash{$1}=$1; + } + } + return %returnhash; +} # ==================================================== Figure out author access @@ -107,6 +97,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");
@@ -116,15 +109,19 @@ $selscript $bodytag +