--- loncom/interface/loncreateuser.pm 2006/08/31 02:19:50 1.125.2.6 +++ loncom/interface/loncreateuser.pm 2006/11/21 21:03:06 1.133 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.125.2.6 2006/08/31 02:19:50 albertel Exp $ +# $Id: loncreateuser.pm,v 1.133 2006/11/21 21:03:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -313,18 +313,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.act.name = "act"+coursename - document.cu.sec.value = section - document.cu.sec.name = "sec"+coursename - document.cu.start.name = "start"+coursename - document.cu.end.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(); @@ -340,7 +349,7 @@ sub print_user_modification_page { } function setType() { - var crstype = 'Course' + 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") { @@ -772,7 +781,7 @@ END $currentauth=~/^internal:/ or $currentauth=~/^localauth:/ ) { # bad authentication scheme - if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { + if (&Apache::lonnet::allowed('mau',$ccdomain)) { &initialize_authen_forms(); my %lt=&Apache::lonlocal::texthash( 'err' => "ERROR", @@ -795,7 +804,7 @@ $lt{'uuas'} ($currentauth). $lt{'sldb'}.

$authformloc

ENDBADAUTH } else { - # This user is not allowed to modify the users + # This user is not allowed to modify the user's # authentication scheme, so just notify them of the problem my %lt=&Apache::lonlocal::texthash( 'err' => "ERROR", @@ -804,9 +813,6 @@ ENDBADAUTH ); $r->print(< - $lt{'err'}: $lt{'uuas'} ($currentauth). $lt{'adcs'}.
@@ -837,7 +843,7 @@ ENDBADAUTH "

$authformint

$authformfsys

"; } $authformcurrent.=' (will override current values)
'; - if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { + if (&Apache::lonnet::allowed('mau',$ccdomain)) { # Current user has login modification privileges my %lt=&Apache::lonlocal::texthash( 'ccld' => "Change Current Login Data", @@ -855,6 +861,19 @@ $loginscript

$lt{'enld'}

$authform_other ENDOTHERAUTHS + } else { + if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { + my %lt=&Apache::lonlocal::texthash( + 'ccld' => "Change Current Login Data", + 'yodo' => "You do not have privileges to modify the authentication configuration for this user.", + 'ifch' => "If a change is required, contact a domain coordinator for the domain", + ); + $r->print(< +

$lt{'ccld'}

+$lt{'yodo'} $lt{'ifch'}: $ccdomain +ENDNOPRIV + } } } ## End of "check for bad authentication type" logic } ## End of new user/old user logic @@ -1801,7 +1820,7 @@ sub course_level_dc { ''; my $courseform=''.&Apache::loncommon::selectcourse_link ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Course').''; - my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom); + my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom,'currsec','cu'); my %lt=&Apache::lonlocal::texthash( 'typ' => "Type", 'rol' => "Role", @@ -1814,8 +1833,13 @@ sub course_level_dc { 'sed' => "Set End Date" ); my $header = '

'.&mt('Course Level').'

'. - ''; - my $otheritems = ''."\n". + '
'.$courseform.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'
'; + my $otheritems = ''."\n". '
'.$lt{'typ'}.''.$courseform.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'
'."\n". + '