--- loncom/interface/loncreateuser.pm 2006/06/27 17:48:53 1.123
+++ loncom/interface/loncreateuser.pm 2007/09/12 23:26:25 1.184
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.123 2006/06/27 17:48:53 albertel Exp $
+# $Id: loncreateuser.pm,v 1.184 2007/09/12 23:26:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,8 +65,7 @@ use Apache::lonnet;
use Apache::loncommon;
use Apache::lonlocal;
use Apache::longroup;
-use lib '/home/httpd/lib/perl/';
-use LONCAPA;
+use LONCAPA qw(:DEFAULT :match);
my $loginscript; # piece of javascript used in two separate instances
my $generalrule;
@@ -99,8 +98,8 @@ sub initialize_authen_forms {
sub my_custom_roles {
my %returnhash=();
my %rolehash=&Apache::lonnet::dump('roles');
- foreach (keys %rolehash) {
- if ($_=~/^rolesdef\_(\w+)$/) {
+ foreach my $key (keys %rolehash) {
+ if ($key=~/^rolesdef\_(\w+)$/) {
$returnhash{$1}=$1;
}
}
@@ -116,52 +115,143 @@ sub authorpriv {
return 1;
}
+# ====================================================
+
+sub portfolio_quota {
+ my ($ccuname,$ccdomain) = @_;
+ my %lt = &Apache::lonlocal::texthash(
+ 'disk' => "Disk space allocated to user's portfolio files",
+ 'cuqu' => "Current quota",
+ 'cust' => "Custom quota",
+ 'defa' => "Default",
+ 'chqu' => "Change quota",
+ );
+ my ($currquota,$quotatype,$inststatus,$defquota) =
+ &Apache::loncommon::get_user_quota($ccuname,$ccdomain);
+ my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($ccdomain);
+ my ($longinsttype,$showquota,$custom_on,$custom_off,$defaultinfo);
+ if ($inststatus ne '') {
+ if ($usertypes->{$inststatus} ne '') {
+ $longinsttype = $usertypes->{$inststatus};
+ }
+ }
+ $custom_on = ' ';
+ $custom_off = ' checked="checked" ';
+ my $quota_javascript = <<"END_SCRIPT";
+
+END_SCRIPT
+ if ($quotatype eq 'custom') {
+ $custom_on = $custom_off;
+ $custom_off = ' ';
+ $showquota = $currquota;
+ if ($longinsttype eq '') {
+ $defaultinfo = &mt('For this user, the default quota would be [_1]
+ Mb.',$defquota);
+ } else {
+ $defaultinfo = &mt("For this user, the default quota would be [_1]
+ Mb, as determined by the user's institutional
+ affiliation ([_2]).",$defquota,$longinsttype);
+ }
+ } else {
+ if ($longinsttype eq '') {
+ $defaultinfo = &mt('For this user, the default quota is [_1]
+ Mb.',$defquota);
+ } else {
+ $defaultinfo = &mt("For this user, the default quota of [_1]
+ Mb, is determined by the user's institutional
+ affiliation ([_2]).",$defquota,$longinsttype);
+ }
+ }
+ my $output = $quota_javascript.
+ '
'.$lt{'disk'}.' '.
+ $lt{'cuqu'}.': '.$currquota.' Mb. '.
+ $defaultinfo.''.$lt{'chqu'}.
+ ': '.
+ ' '.$lt{'defa'}.' ('.$defquota.' Mb). '.
+ ' '.
+ $lt{'cust'}.': '.
+ ' Mb';
+ return $output;
+}
+
# =================================================================== Phase one
sub print_username_entry_form {
- my ($r) = @_;
+ my ($r,$response,$srch,$forcenewuser) = @_;
my $defdom=$env{'request.role.domain'};
- my @domains = &Apache::loncommon::get_domains();
- my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
- my $selscript=&Apache::loncommon::studentbrowser_javascript();
+ my $formtoset = 'crtuser';
+ if (exists($env{'form.startrolename'})) {
+ $formtoset = 'docustom';
+ $env{'form.rolename'} = $env{'form.startrolename'};
+ }
+
+ my ($jsback,$elements) = &crumb_utilities();
+
+ my $jscript = &Apache::loncommon::studentbrowser_javascript()."\n".
+ ''."\n";
+
+ my %loaditems = (
+ 'onload' => "javascript:setFormElements(document.$formtoset)",
+ );
my $start_page =
&Apache::loncommon::start_page('Create Users, Change User Privileges',
- $selscript);
+ $jscript,{'add_entries' => \%loaditems,});
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.crtuser)",
+ text=>"User modify/custom role edit",
+ faq=>282,bug=>'Instructor Interface',});
- my $sellink=&Apache::loncommon::selectstudent_link
- ('crtuser','ccuname','ccdomain');
+ my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management');
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",
+ 'srch' => "User Search",
+ or => "or",
+ '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"
+ 'cre' => "Custom Role Editor",
+ 'mod' => "to add/modify roles",
);
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");
+ my $sellink=&Apache::loncommon::selectstudent_link('crtuser','srchterm','srchdomain');
+ if ($sellink) {
+ $sellink = "$lt{'or'} ".$sellink;
+ }
+ $r->print("
$start_page
-
-ENDDOCUMENT
- if (&Apache::lonnet::allowed('mcr','/')) {
- $r->print(<$lt{'srch'} $sellink $lt{'mod'}
+$response");
+ $r->print(&entry_form($defdom,$srch,$forcenewuser));
+ if (&Apache::lonnet::allowed('mcr','/')) {
+ $r->print(<
-
+
$lt{'ecrp'}$helpecpr
$lt{'nr'}: $choice
@@ -171,6 +261,21 @@ ENDCUSTOM
$r->print(&Apache::loncommon::end_page());
}
+sub entry_form {
+ my ($dom,$srch,$forcenewuser) = @_;
+ my $userpicker =
+ &Apache::loncommon::user_picker($dom,$srch,$forcenewuser,
+ 'document.crtuser');
+ my $srchbutton = &mt('Search');
+ my $output = <<"ENDDOCUMENT";
+
+ENDDOCUMENT
+ return $output;
+}
sub user_modification_js {
my ($pjump_def,$dc_setcourse_code,$nondc_setsection_code,$groupslist)=@_;
@@ -200,19 +305,128 @@ END
}
# =================================================================== Phase two
-sub print_user_modification_page {
- my $r=shift;
- my $ccuname=$env{'form.ccuname'};
- my $ccdomain=$env{'form.ccdomain'};
+sub print_user_selection_page {
+ my ($r,$response,$srch,$srch_results,$context,$srcharray) = @_;
+ my @fields = ('username','domain','lastname','firstname','permanentemail');
+ my $sortby = $env{'form.sortby'};
+
+ if (!grep(/^\Q$sortby\E$/,@fields)) {
+ $sortby = 'lastname';
+ }
+
+ my ($jsback,$elements) = &crumb_utilities();
+
+ my $jscript = (<
+function pickuser(uname,udom) {
+ document.usersrchform.seluname.value=uname;
+ document.usersrchform.seludom.value=udom;
+ document.usersrchform.phase.value="userpicked";
+ document.usersrchform.submit();
+}
+
+$jsback
+
+ENDSCRIPT
+
+ my %lt=&Apache::lonlocal::texthash(
+ 'usrch' => "User Search to add/modify roles",
+ 'stusrch' => "User Search to enroll student",
+ 'usel' => "Select a user to add/modify roles",
+ 'stusel' => "Select a user to enroll as a student",
+ 'username' => "username",
+ 'domain' => "domain",
+ 'lastname' => "last name",
+ 'firstname' => "first name",
+ 'permanentemail' => "permanent e-mail",
+ );
+ if ($context eq 'createuser') {
+ $r->print(&Apache::loncommon::start_page('Create Users, Change User Privileges',$jscript));
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.usersrchform,'','')",
+ text=>"User modify/custom role edit",
+ faq=>282,bug=>'Instructor Interface',},
+ {href=>"javascript:backPage(document.usersrchform,'get_user_info','select')",
+ text=>"Select User",
+ faq=>282,bug=>'Instructor Interface',});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $r->print("$lt{'usrch'} ");
+ $r->print(&entry_form($srch->{'srchdomain'},$srch));
+ $r->print(''.$lt{'usel'}.' ');
+ } else {
+ $r->print($jscript."$lt{'stusrch'} ");
+ $r->print(&Apache::londropadd::single_user_entry_form($srch->{'srchdomain'},$srch));
+ $r->print(''.$lt{'stusel'}.' ');
+ }
+ $r->print(''.&Apache::loncommon::end_page());
+ } else {
+ $r->print(' '."\n".
+ ' '."\n");
+ }
+}
- $ccuname=~s/\W//g;
- $ccdomain=~s/\W//g;
+sub print_user_query_page {
+ my ($r,$caller) = @_;
+# FIXME - this is for a network-wide name search (similar to catalog search)
+# To use frames with similar behavior to catalog/portfolio search.
+# To be implemented.
+ return;
+}
+sub print_user_modification_page {
+ my ($r,$ccuname,$ccdomain,$srch,$response) = @_;
unless (($ccuname) && ($ccdomain)) {
&print_username_entry_form($r);
return;
}
-
+ if ($response) {
+ $response = ' '.$response
+ }
my $defdom=$env{'request.role.domain'};
my ($krbdef,$krbdefdom) =
@@ -221,12 +435,10 @@ sub print_user_modification_page {
my %param = ( formname => 'document.cu',
kerb_def_dom => $krbdefdom,
kerb_def_auth => $krbdef
- );
+ );
$loginscript = &Apache::loncommon::authform_header(%param);
$authformkrb = &Apache::loncommon::authform_kerberos(%param);
- $ccuname=~s/\W//g;
- $ccdomain=~s/\W//g;
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
my $dc_setcourse_code = '';
my $nondc_setsection_code = '';
@@ -240,7 +452,7 @@ sub print_user_modification_page {
$groupslist = '"'.$groupslist.'"';
}
- if ($env{'request.role'} =~ m-^dc\./(\w+)/$-) {
+ if ($env{'request.role'} =~ m-^dc\./($match_domain)/$-) {
my $dcdom = $1;
$loaditem{'onload'} = "document.cu.coursedesc.value='';";
my @rolevals = ('st','ta','ep','in','cc');
@@ -313,18 +525,27 @@ sub print_user_modification_page {
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections.");
section = "";
}
+ var coursename = "_$dcdom"+"_"+course+"_"+userrole
var numcourse = getIndex(document.cu.dccourse);
if (numcourse == "-1") {
alert("There was a problem with your course selection");
return
}
- else {
- var coursename = "_$dcdom"+"_"+course+"_"+userrole
- document.cu.elements[numcourse].name = "act"+coursename
- document.cu.elements[numcourse+5].name = "sec"+coursename
- document.cu.elements[numcourse+5].value = section
- document.cu.elements[numcourse+7].name = "start"+coursename
- document.cu.elements[numcourse+8].name = "end"+coursename
+ else {
+ document.cu.elements[numcourse].name = "act"+coursename;
+ var numnewsec = getIndex(document.cu.newsec);
+ if (numnewsec != "-1") {
+ document.cu.elements[numnewsec].name = "sec"+coursename;
+ document.cu.elements[numnewsec].value = section;
+ }
+ var numstart = getIndex(document.cu.start);
+ if (numstart != "-1") {
+ document.cu.elements[numstart].name = "start"+coursename;
+ }
+ var numend = getIndex(document.cu.end);
+ if (numend != "-1") {
+ document.cu.elements[numend].name = "end"+coursename
+ }
}
}
document.cu.submit();
@@ -338,36 +559,6 @@ sub print_user_modification_page {
}
return -1;
}
-
- function setType() {
- var crstype = document.cu.crstype.options[document.cu.crstype.selectedIndex].value;
- rolevals = new Array("$rolevalslist");
- if (crstype == 'Group') {
- if (document.cu.currsec.options[0].text == "$pickcrsfirst") {
- document.cu.currsec.options[0].text = "$pickgrpfirst";
- }
- grprolenames = new Array("$grprolenameslist");
- for (var i=0; i 1)) {
alert("In each course, each user may only have one student role at a time. You had selected "+numsec+" sections.\\nPlease modify your selections so they include no more than one section.")
return;
}
- else {
+ else if (numsplit != null) {
for (var j=0; j'."\n".$jsback."\n".'';
+
my $start_page =
&Apache::loncommon::start_page('Create Users, Change User Privileges',
$js,{'add_entries' => \%loaditem,});
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.cu)",
+ text=>"User modify/custom role edit",
+ faq=>282,bug=>'Instructor Interface',});
+
+ if ($env{'form.phase'} eq 'userpicked') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.cu,'get_user_info','select')",
+ text=>"Select a user",
+ faq=>282,bug=>'Instructor Interface',});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.cu,'$env{'form.phase'}','modify')",
+ text=>"Set user role",
+ faq=>282,bug=>'Instructor Interface',});
+ my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management');
my $forminfo =<<"ENDFORMINFO";
".&Apache::loncommon::end_page());
}
# ================================================================= Phase Three
sub update_user_data {
- my $r=shift;
+ my ($r) = @_;
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -973,16 +1245,41 @@ sub update_user_data {
} else {
$title='Modify User Privileges';
}
- $r->print(&Apache::loncommon::start_page($title));
+
+ my ($jsback,$elements) = &crumb_utilities();
+ my $jscript = ''."\n";
+
+ $r->print(&Apache::loncommon::start_page($title,$jscript));
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate)",
+ text=>"User modify/custom role edit",
+ faq=>282,bug=>'Instructor Interface',});
+ if ($env{'form.prevphase'} eq 'userpicked') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate,'get_user_info','select')",
+ text=>"Select a user",
+ faq=>282,bug=>'Instructor Interface',});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
+ text=>"Set user role",
+ faq=>282,bug=>'Instructor Interface',},
+ {href=>"/adm/createuser",
+ text=>"Result",
+ faq=>282,bug=>'Instructor Interface',});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+
my %disallowed;
# Check Inputs
if (! $env{'form.ccuname'} ) {
$r->print($error.&mt('No login name specified').'.'.$end);
return;
}
- if ( $env{'form.ccuname'} =~/\W/) {
+ if ( $env{'form.ccuname'} ne
+ &LONCAPA::clean_username($env{'form.ccuname'}) ) {
$r->print($error.&mt('Invalid login name').'. '.
- &mt('Only letters, numbers, and underscores are valid').'.'.
+ &mt('Only letters, numbers, periods, dashes, @, and underscores are valid').'.'.
$end);
return;
}
@@ -990,9 +1287,10 @@ sub update_user_data {
$r->print($error.&mt('No domain specified').'.'.$end);
return;
}
- if ( $env{'form.ccdomain'} =~/\W/) {
+ if ( $env{'form.ccdomain'} ne
+ &LONCAPA::clean_domain($env{'form.ccdomain'}) ) {
$r->print($error.&mt ('Invalid domain name').'. '.
- &mt('Only letters, numbers, and underscores are valid').'.'.
+ &mt('Only letters, numbers, periods, dashes, and underscores are valid').'.'.
$end);
return;
}
@@ -1032,15 +1330,13 @@ sub update_user_data {
$r->print($error.&mt('Invalid login mode or password').$end);
return;
}
+
+
+ $r->print(''.&mt('User [_1] in domain [_2]',
+ $env{'form.ccuname'}, $env{'form.ccdomain'}).' ');
+
if ($env{'form.makeuser'}) {
- # Create a new user
- my %lt=&Apache::lonlocal::texthash(
- 'cru' => "Creating user",
- 'id' => "in domain"
- );
- $r->print(<$lt{'cru'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"
-ENDNEWUSERHEAD
+ $r->print(''.&mt('Creating new account.').' ');
# Check for the authentication mode and password
if (! $amode || ! $genpwd) {
$r->print($error.&mt('Invalid login mode or password').$end);
@@ -1051,8 +1347,8 @@ ENDNEWUSERHEAD
if (lc($desiredhost) eq 'default') {
$desiredhost = undef;
} else {
- my %home_servers = &Apache::loncommon::get_library_servers
- ($env{'form.ccdomain'});
+ my %home_servers =
+ &Apache::lonnet::get_servers($env{'form.ccdomain'},'library');
if (! exists($home_servers{$desiredhost})) {
$r->print($error.&mt('Invalid home server specified'));
return;
@@ -1063,23 +1359,16 @@ ENDNEWUSERHEAD
($env{'form.ccdomain'},$env{'form.ccuname'},$env{'form.cstid'},
$amode,$genpwd,$env{'form.cfirst'},
$env{'form.cmiddle'},$env{'form.clast'},$env{'form.cgen'},
- undef,$desiredhost
+ undef,$desiredhost,$env{'form.cemail'}
);
$r->print(&mt('Generating user').': '.$result);
my $home = &Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
$r->print(' '.&mt('Home server').': '.$home.' '.
- $Apache::lonnet::libserv{$home});
+ &Apache::lonnet::hostname($home));
} elsif (($env{'form.login'} ne 'nochange') &&
($env{'form.login'} ne '' )) {
# Modify user privileges
- my %lt=&Apache::lonlocal::texthash(
- 'usr' => "User",
- 'id' => "in domain"
- );
- $r->print(<$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"
-ENDMODIFYUSERHEAD
if (! $amode || ! $genpwd) {
$r->print($error.'Invalid login mode or password'.$end);
return;
@@ -1101,28 +1390,83 @@ ENDMODIFYUSERHEAD
if (! $env{'form.makeuser'} ) {
# Check for need to change
my %userenv = &Apache::lonnet::get
- ('environment',['firstname','middlename','lastname','generation'],
- $env{'form.ccdomain'},$env{'form.ccuname'});
+ ('environment',['firstname','middlename','lastname','generation',
+ 'permanentemail','portfolioquota','inststatus'],
+ $env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
if ($tmp =~ /^(con_lost|error)/i) {
%userenv = ();
}
# Check to see if we need to change user information
- foreach ('firstname','middlename','lastname','generation') {
+ foreach my $item ('firstname','middlename','lastname','generation','permanentemail') {
# Strip leading and trailing whitespace
- $env{'form.c'.$_} =~ s/(\s+$|^\s+)//g;
+ $env{'form.c'.$item} =~ s/(\s+$|^\s+)//g;
+ }
+ my ($quotachanged,$namechanged,$oldportfolioquota,$newportfolioquota,
+ $inststatus,$isdefault,$defquotatext);
+ my ($defquota,$settingstatus) =
+ &Apache::loncommon::default_quota($env{'form.ccdomain'},$inststatus);
+ my %changeHash;
+ if ($userenv{'portfolioquota'} ne '') {
+ $oldportfolioquota = $userenv{'portfolioquota'};
+ if ($env{'form.customquota'} == 1) {
+ if ($env{'form.portfolioquota'} eq '') {
+ $newportfolioquota = 0;
+ } else {
+ $newportfolioquota = $env{'form.portfolioquota'};
+ $newportfolioquota =~ s/[^\d\.]//g;
+ }
+ if ($newportfolioquota != $userenv{'portfolioquota'}) {
+ $quotachanged = "a_admin($newportfolioquota,\%changeHash);
+ }
+ } else {
+ $quotachanged = "a_admin('',\%changeHash);
+ $newportfolioquota = $defquota;
+ $isdefault = 1;
+ }
+ } else {
+ $oldportfolioquota = $defquota;
+ if ($env{'form.customquota'} == 1) {
+ if ($env{'form.portfolioquota'} eq '') {
+ $newportfolioquota = 0;
+ } else {
+ $newportfolioquota = $env{'form.portfolioquota'};
+ $newportfolioquota =~ s/[^\d\.]//g;
+ }
+ $quotachanged = "a_admin($newportfolioquota,\%changeHash);
+ } else {
+ $newportfolioquota = $defquota;
+ $isdefault = 1;
+ }
+ }
+ if ($isdefault) {
+ if ($settingstatus eq '') {
+ $defquotatext = &mt('(default)');
+ } else {
+ my ($usertypes,$order) =
+ &Apache::lonnet::retrieve_inst_usertypes($env{'form.ccdomain'});
+ if ($usertypes->{$settingstatus} eq '') {
+ $defquotatext = &mt('(default)');
+ } else {
+ $defquotatext = &mt('(default for [_1])',$usertypes->{$settingstatus});
+ }
+ }
}
if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) &&
($env{'form.cfirstname'} ne $userenv{'firstname'} ||
$env{'form.cmiddlename'} ne $userenv{'middlename'} ||
$env{'form.clastname'} ne $userenv{'lastname'} ||
- $env{'form.cgeneration'} ne $userenv{'generation'} )) {
+ $env{'form.cgeneration'} ne $userenv{'generation'} ||
+ $env{'form.cpermanentemail'} ne $userenv{'permanentemail'} )) {
+ $namechanged = 1;
+ }
+ if ($namechanged) {
# Make the change
- my %changeHash;
$changeHash{'firstname'} = $env{'form.cfirstname'};
$changeHash{'middlename'} = $env{'form.cmiddlename'};
$changeHash{'lastname'} = $env{'form.clastname'};
$changeHash{'generation'} = $env{'form.cgeneration'};
+ $changeHash{'permanentemail'} = $env{'form.cpermanentemail'};
my $putresult = &Apache::lonnet::put
('environment',\%changeHash,
$env{'form.ccdomain'},$env{'form.ccuname'});
@@ -1134,6 +1478,8 @@ ENDMODIFYUSERHEAD
'mddl' => "middle",
'lst' => "last",
'gen' => "generation",
+ 'mail' => "permanent e-mail",
+ 'disk' => "disk space allocated to portfolio files",
'prvs' => "Previous",
'chto' => "Changed To"
);
@@ -1144,112 +1490,132 @@ ENDMODIFYUSERHEAD
$lt{'frst'}
$lt{'mddl'}
$lt{'lst'}
- $lt{'gen'}
+ $lt{'gen'}
+ $lt{'mail'}
+ $lt{'disk'}
$lt{'prvs'}
$userenv{'firstname'}
$userenv{'middlename'}
$userenv{'lastname'}
- $userenv{'generation'}
+ $userenv{'generation'}
+ $userenv{'permanentemail'}
+ $oldportfolioquota Mb
+
$lt{'chto'}
$env{'form.cfirstname'}
$env{'form.cmiddlename'}
$env{'form.clastname'}
- $env{'form.cgeneration'}
+ $env{'form.cgeneration'}
+ $env{'form.cpermanentemail'}
+ $newportfolioquota Mb $defquotatext
END
+ if (($env{'form.ccdomain'} eq $env{'user.domain'}) &&
+ ($env{'form.ccuname'} eq $env{'user.name'})) {
+ my %newenvhash;
+ foreach my $key (keys(%changeHash)) {
+ $newenvhash{'environment.'.$key} = $changeHash{$key};
+ }
+ &Apache::lonnet::appenv(%newenvhash);
+ }
} else { # error occurred
$r->print("".&mt('Unable to successfully change environment for')." ".
$env{'form.ccuname'}." ".&mt('in domain')." ".
$env{'form.ccdomain'}." ");
}
} else { # End of if ($env ... ) logic
+ my $putresult;
+ if ($quotachanged) {
+ $putresult = &Apache::lonnet::put
+ ('environment',\%changeHash,
+ $env{'form.ccdomain'},$env{'form.ccuname'});
+ }
# They did not want to change the users name but we can
# still tell them what the name is
my %lt=&Apache::lonlocal::texthash(
- 'usr' => "User",
- 'id' => "in domain",
- 'gen' => "Generation"
+ 'mail' => "Permanent e-mail",
+ 'disk' => "Disk space allocated to user's portfolio files",
);
- $r->print(<<"END");
-$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"
-$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'}
-$lt{'gen'}: $userenv{'generation'}
+ $r->print(<<"END");
+$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} $userenv{'generation'}
+$lt{'mail'}: $userenv{'permanentemail'}
END
+ if ($putresult eq 'ok') {
+ if ($oldportfolioquota != $newportfolioquota) {
+ $r->print(''.$lt{'disk'}.': '.$newportfolioquota.' Mb '.
+ $defquotatext.' ');
+ &Apache::lonnet::appenv('environment.portfolioquota' => $changeHash{'portfolioquota'});
+ }
+ }
}
}
##
my $now=time;
$r->print(''.&mt('Modifying Roles').' ');
- foreach (keys (%env)) {
- next if (! $env{$_});
+ foreach my $key (keys (%env)) {
+ next if (! $env{$key});
# Revoke roles
- if ($_=~/^form\.rev/) {
- if ($_=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {
+ if ($key=~/^form\.rev/) {
+ if ($key=~/^form\.rev\:([^\_]+)\_([^\_\.]+)$/) {
# Revoke standard role
- $r->print(&mt('Revoking').' '.$2.' in '.$1.': '.
- &Apache::lonnet::revokerole($env{'form.ccdomain'},
- $env{'form.ccuname'},$1,$2).' ');
- if ($2 eq 'st') {
- $1=~/^\/(\w+)\/(\w+)/;
- my $cid=$1.'_'.$2;
- $r->print(&mt('Drop from classlist').': '.
- &Apache::lonnet::critical('put:'.
- $env{'course.'.$cid.'.domain'}.':'.
- $env{'course.'.$cid.'.num'}.':classlist:'.
- &escape($env{'form.ccuname'}.':'.
- $env{'form.ccdomain'}).'='.
- &escape($now.':'),
- $env{'course.'.$cid.'.home'}).' ');
+ my ($scope,$role) = ($1,$2);
+ my $result =
+ &Apache::lonnet::revokerole($env{'form.ccdomain'},
+ $env{'form.ccuname'},
+ $scope,$role);
+ $r->print(&mt('Revoking [_1] in [_2]: [_3]',
+ $role,$scope,''.$result.' ').' ');
+ if ($role eq 'st') {
+ my $result = &classlist_drop($scope,$env{'form.ccuname'},
+ $env{'form.ccdomain'},$now);
+ $r->print($result);
}
}
- if ($_=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$ }s) {
# Revoke custom role
$r->print(&mt('Revoking custom role:').
- ' '.$4.' by '.$3.'@'.$2.' in '.$1.': '.
+ ' '.$4.' by '.$3.':'.$2.' in '.$1.': '.
&Apache::lonnet::revokecustomrole($env{'form.ccdomain'},
$env{'form.ccuname'},$1,$2,$3,$4).
' ');
}
- } elsif ($_=~/^form\.del/) {
- if ($_=~/^form\.del\:([^\_]+)\_([^\_\.]+)$/) {
+ } elsif ($key=~/^form\.del/) {
+ if ($key=~/^form\.del\:([^\_]+)\_([^\_\.]+)$/) {
# Delete standard role
- $r->print(&mt('Deleting').' '.$2.' in '.$1.': '.
- &Apache::lonnet::assignrole($env{'form.ccdomain'},
- $env{'form.ccuname'},$1,$2,$now,0,1).' ');
- if ($2 eq 'st') {
- $1=~/^\/(\w+)\/(\w+)/;
- my $cid=$1.'_'.$2;
- $r->print(&mt('Drop from classlist').': '.
- &Apache::lonnet::critical('put:'.
- $env{'course.'.$cid.'.domain'}.':'.
- $env{'course.'.$cid.'.num'}.':classlist:'.
- &escape($env{'form.ccuname'}.':'.
- $env{'form.ccdomain'}).'='.
- &escape($now.':'),
- $env{'course.'.$cid.'.home'}).' ');
+ my ($scope,$role) = ($1,$2);
+ my $result =
+ &Apache::lonnet::assignrole($env{'form.ccdomain'},
+ $env{'form.ccuname'},
+ $scope,$role,$now,0,1);
+ $r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope,
+ ''.$result.' ').' ');
+ if ($role eq 'st') {
+ my $result = &classlist_drop($scope,$env{'form.ccuname'},
+ $env{'form.ccdomain'},$now);
+ $r->print($result);
}
}
- if ($_=~/^form\.del\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
# Delete custom role
- $r->print(&mt('Deleting custom role [_1] by [_2]@[_3] in [_4]',
+ $r->print(&mt('Deleting custom role [_1] by [_2]:[_3] in [_4]',
$rolename,$rnam,$rdom,$url).': '.
&Apache::lonnet::assigncustomrole($env{'form.ccdomain'},
$env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
0,1).' ');
}
- } elsif ($_=~/^form\.ren/) {
+ } elsif ($key=~/^form\.ren/) {
my $udom = $env{'form.ccdomain'};
my $uname = $env{'form.ccuname'};
# Re-enable standard role
- if ($_=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) {
+ if ($key=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) {
my $url = $1;
my $role = $2;
my $logmsg;
my $output;
if ($role eq 'st') {
- if ($url =~ m-^/(\w+)/(\w+)/?(\w*)$-) {
- my $result = &commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);
+ if ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) {
+ my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {
$output = "Error: $result\n";
} else {
@@ -1268,7 +1634,7 @@ END
$r->print($output);
}
# Re-enable custom role
- if ($_=~/^form\.ren\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.ren\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
@@ -1276,10 +1642,10 @@ END
$r->print(&mt('Re-enabling custom role [_1] by [_2]@[_3] in [_4] : [_5] ',
$rolename,$rnam,$rdom,$url,$result).' ');
}
- } elsif ($_=~/^form\.act/) {
+ } elsif ($key=~/^form\.act/) {
my $udom = $env{'form.ccdomain'};
my $uname = $env{'form.ccuname'};
- if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
+ if ($key=~/^form\.act\_($match_domain)\_($match_courseid)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {
# Activate a custom role
my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
my $url='/'.$one.'/'.$two;
@@ -1296,7 +1662,7 @@ END
my %sections = ();
my $num_sections = &build_roles($env{'form.sec_'.$full},\%sections,$5);
if ($num_sections == 0) {
- $r->print(&commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end));
+ $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end));
} else {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
@@ -1307,10 +1673,10 @@ END
next;
}
my $securl = $url.'/'.$sec;
- $r->print(&commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
+ $r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
}
}
- } elsif ($_=~/^form\.act\_([^\_]+)\_(\w+)\_([^\_]+)$/) {
+ } elsif ($key=~/^form\.act\_($match_domain)\_($match_name)\_([^\_]+)$/) {
# Activate roles for sections with 3 id numbers
# set start, end times, and the url for the class
my ($one,$two,$three)=($1,$2,$3);
@@ -1326,7 +1692,7 @@ END
my %sections = ();
my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three);
if ($num_sections == 0) {
- $r->print(&commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,''));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,''));
} else {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
@@ -1340,16 +1706,16 @@ END
next;
}
my $securl = $url.'/'.$sec;
- $r->print(&commit_standardrole($udom,$uname,$securl,$three,$start,$end,$one,$two,$sec));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$three,$start,$end,$one,$two,$sec));
} else {
$emptysec = 1;
}
}
if ($emptysec) {
- $r->print(&commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,''));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,''));
}
}
- } elsif ($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
+ } elsif ($key=~/^form\.act\_([^\_]+)\_([^\_]+)$/) {
# Activate roles for sections with two id numbers
# set start, end times, and the url for the class
my $start = ( $env{'form.start_'.$1.'_'.$2} ?
@@ -1363,23 +1729,23 @@ END
my %sections = ();
my $num_sections = &build_roles($env{'form.sec_'.$1.'_'.$2},\%sections,$2);
if ($num_sections == 0) {
- $r->print(&commit_standardrole($udom,$uname,$url,$2,$start,$end,$1,undef,''));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$2,$start,$end,$1,undef,''));
} else {
my $emptysec = 0;
foreach my $sec (sort {$a cmp $b} keys %sections) {
if ($sec ne '') {
my $securl = $url.'/'.$sec;
- $r->print(&commit_standardrole($udom,$uname,$securl,$2,$start,$end,$1,undef,$sec));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$2,$start,$end,$1,undef,$sec));
} else {
$emptysec = 1;
}
}
if ($emptysec) {
- $r->print(&commit_standardrole($udom,$uname,$url,$2,$start,$end,$1,undef,''));
+ $r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$2,$start,$end,$1,undef,''));
}
}
} else {
- $r->print(' '.&mt('ERROR').': '.&mt('Unknown command').' '.$_.'
');
+ $r->print(''.&mt('ERROR').': '.&mt('Unknown command').' '.$key.'
');
}
foreach my $key (sort(keys(%disallowed))) {
if (($key eq 'none') || ($key eq 'all')) {
@@ -1393,91 +1759,55 @@ END
} # End of foreach (keys(%env))
# Flush the course logs so reverse user roles immediately updated
&Apache::lonnet::flushcourselogs();
- $r->print('Create/Modify Another User
');
+ $r->print(''.&mt('Create/Modify Another User').'
');
+ $r->print(''."\n");
+ foreach my $item ('srchby','srchin','srchtype','srchterm','srchdomain','ccuname','ccdomain') {
+ $r->print(' '."\n");
+ }
+ foreach my $item ('sortby','seluname','seludom') {
+ if (exists($env{'form.'.$item})) {
+ $r->print(' '."\n");
+ }
+ }
+ $r->print(' '."\n".
+ ' '."\n".
+ '');
$r->print(&Apache::loncommon::end_page());
}
-sub commit_customrole {
- my ($udom,$uname,$url,$three,$four,$five,$start,$end) = @_;
- my $output = &mt('Assigning custom role').' "'.$five.'" by '.$four.'@'.$three.' in '.$url.
- ($start?', '.&mt('starting').' '.localtime($start):'').
- ($end?', ending '.localtime($end):'').': '.
- &Apache::lonnet::assigncustomrole(
- $udom,$uname,$url,$three,$four,$five,$end,$start).
- ' ';
- return $output;
+sub classlist_drop {
+ my ($scope,$uname,$udom,$now) = @_;
+ my ($cdom,$cnum) = ($scope=~m{^/($match_domain)/($match_courseid)});
+ my $cid=$cdom.'_'.$cnum;
+ my $user = $uname.':'.$udom;
+ if (!&active_student_roles($cnum,$cdom,$uname,$udom)) {
+ my $result =
+ &Apache::lonnet::cput('classlist',
+ { $user => $now },
+ $env{'course.'.$cid.'.domain'},
+ $env{'course.'.$cid.'.num'});
+ return &mt('Drop from classlist: [_1]',
+ ''.$result.' ').' ';
+ }
}
-sub commit_standardrole {
- my ($udom,$uname,$url,$three,$start,$end,$one,$two,$sec) = @_;
- my $output;
- my $logmsg;
- if ($three eq 'st') {
- my $result = &commit_studentrole(\$logmsg,$udom,$uname,$url,$three,$start,$end,$one,$two,$sec);
- if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {
- $output = "Error: $result\n";
- } else {
- $output = &mt('Assigning').' '.$three.' in '.$url.
- ($start?', '.&mt('starting').' '.localtime($start):'').
- ($end?', '.&mt('ending').' '.localtime($end):'').
- ': '.$result.' '.
- &mt('Add to classlist').': ok ';
- }
- } else {
- $output = &mt('Assigning').' '.$three.' in '.$url.
- ($start?', '.&mt('starting').' '.localtime($start):'').
- ($end?', '.&mt('ending').' '.localtime($end):'').': '.
- &Apache::lonnet::assignrole(
- $udom,$uname,$url,$three,$end,$start).
- ' ';
- }
- return $output;
+sub active_student_roles {
+ my ($cnum,$cdom,$uname,$udom) = @_;
+ my %roles =
+ &Apache::lonnet::get_my_roles($uname,$udom,'userroles',
+ ['future','active'],['st']);
+ return exists($roles{"$cnum:$cdom:st"});
}
-sub commit_studentrole {
- my ($logmsg,$udom,$uname,$url,$three,$start,$end,$one,$two,$sec) = @_;
- my $linefeed = ' '."\n";
- my $result;
- if (defined($one) && defined($two)) {
- my $cid=$one.'_'.$two;
- my $oldsec=&Apache::lonnet::getsection($udom,$uname,$cid);
- my $secchange = 0;
- my $expire_role_result;
- my $modify_section_result;
- unless ($oldsec eq '-1') {
- unless ($sec eq $oldsec) {
- $secchange = 1;
- my $uurl='/'.$cid;
- $uurl=~s/\_/\//g;
- if ($oldsec) {
- $uurl.='/'.$oldsec;
- }
- $expire_role_result = &Apache::lonnet::assignrole($udom,$uname,$uurl,'st',time);
- $result = $expire_role_result;
- }
- }
- if (($expire_role_result eq 'ok') || ($secchange == 0)) {
- $modify_section_result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,'','',$cid);
- if ($modify_section_result =~ /^ok/) {
- if ($secchange == 1) {
- $$logmsg .= "Section for $uname switched from old section: $oldsec to new section: $sec".$linefeed;
- } elsif ($oldsec eq '-1') {
- $$logmsg .= "New student role for $uname in section $sec in course $cid".$linefeed;
- } else {
- $$logmsg .= "Student $uname assigned to unchanged section $sec in course $cid".$linefeed;
- }
- } else {
- $$logmsg .= "Error when attempting section change for $uname from old section $oldsec to new section: $sec in course $cid -error: $modify_section_result".$linefeed;
- }
- $result = $modify_section_result;
- } elsif ($secchange == 1) {
- $$logmsg .= "Error when attempting to expire role for $uname in old section $oldsec in course $cid -error: $expire_role_result".$linefeed;
- }
- } else {
- $$logmsg .= "Incomplete course id defined. Addition of user $uname from domain $udom to course $one\_$two, section $sec not completed.$linefeed";
- $result = "error: incomplete course id\n";
+sub quota_admin {
+ my ($setquota,$changeHash) = @_;
+ my $quotachanged;
+ if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) {
+ # Current user has quota modification privileges
+ $quotachanged = 1;
+ $changeHash->{'portfolioquota'} = $setquota;
}
- return $result;
+ return $quotachanged;
}
sub build_roles {
@@ -1492,7 +1822,7 @@ sub build_roles {
} else {
foreach my $sec (@secnums) {
$sec =~ ~s/\W//g;
- unless ($sec eq "") {
+ if (!($sec eq "")) {
if (exists($$sections{$sec})) {
$$sections{$sec} ++;
} else {
@@ -1509,14 +1839,14 @@ sub build_roles {
$num_sections ++;
}
}
-
+
return $num_sections;
}
# ========================================================== Custom Role Editor
sub custom_role_editor {
- my $r=shift;
+ my ($r) = @_;
my $rolename=$env{'form.rolename'};
if ($rolename eq 'make new role') {
@@ -1525,35 +1855,35 @@ sub custom_role_editor {
$rolename=~s/[^A-Za-z0-9]//gs;
- unless ($rolename) {
+ if (!$rolename) {
&print_username_entry_form($r);
return;
}
-
- $r->print(&Apache::loncommon::start_page('Custom Role Editor'));
+# ------------------------------------------------------- What can be assigned?
+ my %full=();
+ my %courselevel=();
+ my %courselevelcurrent=();
my $syspriv='';
my $dompriv='';
my $coursepriv='';
+ my $body_top;
+ my ($disp_dummy,$disp_roles) = &Apache::lonnet::get('roles',["st"]);
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
# ------------------------------------------------------- Does this role exist?
- $r->print('');
+ $body_top .= '';
if (($rdummy ne 'con_lost') && ($roledef ne '')) {
- $r->print(&mt('Existing Role').' "');
+ $body_top .= &mt('Existing Role').' "';
# ------------------------------------------------- Get current role privileges
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef);
} else {
- $r->print(&mt('New Role').' "');
+ $body_top .= &mt('New Role').' "';
$roledef='';
}
- $r->print($rolename.'" ');
-# ------------------------------------------------------- What can be assigned?
- my %full=();
- my %courselevel=();
- my %courselevelcurrent=();
- foreach (split(/\:/,$Apache::lonnet::pr{'cr:c'})) {
- my ($priv,$restrict)=split(/\&/,$_);
- unless ($restrict) { $restrict='F'; }
+ $body_top .= $rolename.'" ';
+ foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) {
+ my ($priv,$restrict)=split(/\&/,$item);
+ if (!$restrict) { $restrict='F'; }
$courselevel{$priv}=$restrict;
if ($coursepriv=~/\:$priv/) {
$courselevelcurrent{$priv}=1;
@@ -1562,9 +1892,9 @@ sub custom_role_editor {
}
my %domainlevel=();
my %domainlevelcurrent=();
- foreach (split(/\:/,$Apache::lonnet::pr{'cr:d'})) {
- my ($priv,$restrict)=split(/\&/,$_);
- unless ($restrict) { $restrict='F'; }
+ foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) {
+ my ($priv,$restrict)=split(/\&/,$item);
+ if (!$restrict) { $restrict='F'; }
$domainlevel{$priv}=$restrict;
if ($dompriv=~/\:$priv/) {
$domainlevelcurrent{$priv}=1;
@@ -1573,47 +1903,149 @@ sub custom_role_editor {
}
my %systemlevel=();
my %systemlevelcurrent=();
- foreach (split(/\:/,$Apache::lonnet::pr{'cr:s'})) {
- my ($priv,$restrict)=split(/\&/,$_);
- unless ($restrict) { $restrict='F'; }
+ foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) {
+ my ($priv,$restrict)=split(/\&/,$item);
+ if (!$restrict) { $restrict='F'; }
$systemlevel{$priv}=$restrict;
if ($syspriv=~/\:$priv/) {
$systemlevelcurrent{$priv}=1;
}
$full{$priv}=1;
}
+ my ($jsback,$elements) = &crumb_utilities();
+ my $button_code = "\n";
+ my $head_script = "\n";
+ $head_script .= ''."\n";
+ $r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script));
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.form1,'','')",
+ text=>"User modify/custom role edit",
+ faq=>282,bug=>'Instructor Interface',},
+ {href=>"javascript:backPage(document.form1,'','')",
+ text=>"Edit custom role",
+ faq=>282,bug=>'Instructor Interface',});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+
+ $r->print($body_top);
my %lt=&Apache::lonlocal::texthash(
'prv' => "Privilege",
- 'crl' => "Course/Group Level",
+ 'crl' => "Course Level",
'dml' => "Domain Level",
- 'ssl' => "System Level"
- );
+ 'ssl' => "System Level");
+ $r->print('Select a Template ');
+ $r->print('');
$r->print(<
+