--- loncom/interface/loncreateuser.pm 2004/01/15 03:18:19 1.76
+++ loncom/interface/loncreateuser.pm 2004/11/23 18:03:04 1.88
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.76 2004/01/15 03:18:19 www Exp $
+# $Id: loncreateuser.pm,v 1.88 2004/11/23 18:03:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -123,10 +123,7 @@ sub print_username_entry_form {
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').
- &Apache::loncommon::help_open_faq(282).
- &Apache::loncommon::help_open_bug('Instructor Interface');
+ 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');
@@ -177,8 +174,8 @@ sub print_user_modification_page {
my $ccuname=$ENV{'form.ccuname'};
my $ccdomain=$ENV{'form.ccdomain'};
- $ccuname=~s/\W//gs;
- $ccdomain=~s/\W//gs;
+ $ccuname=~s/[\W|_]//gs;
+ $ccdomain=~s/[\W|_]//gs;
unless (($ccuname) && ($ccdomain)) {
&print_username_entry_form($r);
@@ -200,6 +197,79 @@ sub print_user_modification_page {
$ccuname=~s/\W//g;
$ccdomain=~s/\W//g;
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
+ my $dc_setcourse_code = '';
+ my $loaditem;
+ if ($ENV{'request.role'} =~ m-^dc\./(\w+)/$-) {
+ my $dcdom = $1;
+ $loaditem = qq|OnLoad="document.cu.coursedesc.value=''"|;
+ $dc_setcourse_code = <<"ENDSCRIPT";
+ function setCourse() {
+ var course = document.cu.dccourse.value;
+ if (course != "") {
+ if (document.cu.dcdomain.value != document.cu.origdom.value) {
+ alert("You must select a course in the current domain");
+ return;
+ }
+ var userrole = document.cu.role.options[document.cu.role.selectedIndex].value
+ var section;
+ var numsections = 0;
+ if (document.cu.role.value != "cc") {
+ for (var i=0; i
@@ -213,6 +283,7 @@ sub print_user_modification_page {
}
$pjump_def
+ $dc_setcourse_code
function dateset() {
eval("document.cu."+document.cu.pres_marker.value+
@@ -224,7 +295,7 @@ sub print_user_modification_page {
ENDDOCHEAD
$r->print(&Apache::loncommon::bodytag(
- 'Create Users, Change User Privileges'));
+ 'Create Users, Change User Privileges',undef,$loaditem));
my $forminfo =<<"ENDFORMINFO";
@@ -295,7 +367,7 @@ $lt{'hs'}: