--- loncom/interface/loncreateuser.pm 2007/12/21 15:22:01 1.216 +++ loncom/interface/loncreateuser.pm 2007/12/21 16:23:54 1.218 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.216 2007/12/21 15:22:01 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.218 2007/12/21 16:23:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -805,181 +805,294 @@ ENDNOPORTPRIV } } $r->print(''); - my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); - # Build up table of user roles to allow revocation of a role. - my ($tmp) = keys(%rolesdump); - unless ($tmp =~ /^(con_lost|error)/i) { - my $now=time; - my %lt=&Apache::lonlocal::texthash( - 'rer' => "Existing Roles", - 'rev' => "Revoke", + if ($env{'form.action'} ne 'singlestudent') { + &display_existing_roles($r,$ccuname,$ccdomain,\%inccourses); + } + } ## End of new user/old user logic + + if ($env{'form.action'} eq 'singlestudent') { + $r->print('
'."\n"); + } else { + $r->print('

'.&mt('Add Roles').'

'); + my $addrolesdisplay = 0; + if ($context eq 'domain' || $context eq 'author') { + $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain); + } + if ($context eq 'domain') { + my $add_domainroles = &new_domain_roles($r); + if (!$addrolesdisplay) { + $addrolesdisplay = $add_domainroles; + } + $r->print(&course_level_dc($env{'request.role.domain'},'Course')); + $r->print('
'."\n"); + } elsif ($context eq 'author') { + if ($addrolesdisplay) { + $r->print('
print(' onClick="verify_message(this.form)" \>'."\n"); + } else { + $r->print('onClick="this.form.submit()" \>'."\n"); + } + } else { + $r->print('
'. + &mt('Back to previous page').''); + } + } else { + $r->print(&course_level_table(%inccourses)); + $r->print('
'."\n"); + } + } + $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); + $r->print(''); + $r->print(''); + $r->print("".&Apache::loncommon::end_page()); + return; +} + +sub singleuser_breadcrumb { + my %breadcrumb_text; + if ($env{'form.action'} eq 'singlestudent') { + $breadcrumb_text{'search'} = 'Enroll a student'; + $breadcrumb_text{'userpicked'} = 'Select a user', + $breadcrumb_text{'modify'} = 'Set section/dates', + } else { + $breadcrumb_text{'search'} = 'Create/modify user'; + $breadcrumb_text{'userpicked'} = 'Select a user', + $breadcrumb_text{'modify'} = 'Set user role', + } + return %breadcrumb_text; +} + +sub date_sections_select { + my ($context,$newuser,$formname,$permission) = @_; + my $cid = $env{'request.course.id'}; + my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity($cid); + my $date_table = '

'.&mt('Starting and Ending Dates').'

'."\n". + &Apache::lonuserutils::date_setting_table(undef,undef,$context, + undef,$formname,$permission); + my $rowtitle = 'Section'; + my $secbox = '

'.&mt('Section').'

'."\n". + &Apache::lonuserutils::section_picker($cdom,$cnum,'st',$rowtitle, + $permission); + my $output = $date_table.$secbox; + return $output; +} + +sub validation_javascript { + my ($context,$ccdomain,$pjump_def,$groupslist,$newuser,$formname, + $loaditem) = @_; + my $dc_setcourse_code = ''; + my $nondc_setsection_code = ''; + if ($context eq 'domain') { + my $dcdom = $env{'request.role.domain'}; + $loaditem->{'onload'} = "document.cu.coursedesc.value='';"; + $dc_setcourse_code = &Apache::lonuserutils::dc_setcourse_js('cu','singleuser'); + } else { + $nondc_setsection_code = + &Apache::lonuserutils::setsections_javascript($formname,$groupslist); + } + my $js = &user_modification_js($pjump_def,$dc_setcourse_code, + $nondc_setsection_code,$groupslist); + + my ($jsback,$elements) = &crumb_utilities(); + my $javascript_validations; + if ((&Apache::lonnet::allowed('mau',$ccdomain)) || ($newuser)) { + my ($krbdef,$krbdefdom) = + &Apache::loncommon::get_kerberos_defaults($ccdomain); + $javascript_validations = + &Apache::lonuserutils::javascript_validations('createuser',$krbdefdom,undef, + undef,$ccdomain); + } + $js .= "\n". + ''; + return $js; +} + +sub display_existing_roles { + my ($r,$ccuname,$ccdomain,$inccourses) = @_; + my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); + # Build up table of user roles to allow revocation and re-enabling of roles. + my ($tmp) = keys(%rolesdump); + if ($tmp !~ /^(con_lost|error)/i) { + my $now=time; + my %lt=&Apache::lonlocal::texthash( + 'rer' => "Existing Roles", + 'rev' => "Revoke", 'del' => "Delete", - 'ren' => "Re-Enable", + 'ren' => "Re-Enable", 'rol' => "Role", 'ext' => "Extent", 'sta' => "Start", - 'end' => "End" - ); - my (%roletext,%sortrole,%roleclass,%rolepriv); - foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]); - my $b1=join('_',(split('_',$b))[1,0]); - return $a1 cmp $b1; - } keys(%rolesdump)) { - next if ($area =~ /^rolesdef/); - my $envkey=$area; - my $role = $rolesdump{$area}; - my $thisrole=$area; - $area =~ s/\_\w\w$//; - my ($role_code,$role_end_time,$role_start_time) = - split(/_/,$role); + 'end' => "End", + ); + my (%roletext,%sortrole,%roleclass,%rolepriv); + foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]); + my $b1=join('_',(split('_',$b))[1,0]); + return $a1 cmp $b1; + } keys(%rolesdump)) { + next if ($area =~ /^rolesdef/); + my $envkey=$area; + my $role = $rolesdump{$area}; + my $thisrole=$area; + $area =~ s/\_\w\w$//; + my ($role_code,$role_end_time,$role_start_time) = + split(/_/,$role); # Is this a custom role? Get role owner and title. - my ($croleudom,$croleuname,$croletitle)= - ($role_code=~m{^cr/($match_domain)/($match_username)/(\w+)$}); - my $allowed=0; - my $delallowed=0; - my $sortkey=$role_code; - my $class='Unknown'; - if ($area =~ m{^/($match_domain)/($match_courseid)} ) { - $class='Course'; - my ($coursedom,$coursedir) = ($1,$2); - $sortkey.="\0$coursedom"; - # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). - my %coursedata= - &Apache::lonnet::coursedescription($1.'_'.$2); - my $carea; - if (defined($coursedata{'description'})) { - $carea=$coursedata{'description'}. - '
'.&mt('Domain').': '.$coursedom.(' 'x8). + my ($croleudom,$croleuname,$croletitle)= + ($role_code=~m{^cr/($match_domain)/($match_username)/(\w+)$}); + my $allowed=0; + my $delallowed=0; + my $sortkey=$role_code; + my $class='Unknown'; + if ($area =~ m{^/($match_domain)/($match_courseid)} ) { + $class='Course'; + my ($coursedom,$coursedir) = ($1,$2); + $sortkey.="\0$coursedom"; + # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). + my %coursedata= + &Apache::lonnet::coursedescription($1.'_'.$2); + my $carea; + if (defined($coursedata{'description'})) { + $carea=$coursedata{'description'}. + '
'.&mt('Domain').': '.$coursedom.(' 'x8). &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom); - $sortkey.="\0".$coursedata{'description'}; - $class=$coursedata{'type'}; - } else { - $carea=&mt('Unavailable course').': '.$area; - $sortkey.="\0".&mt('Unavailable course').': '.$area; - } - $sortkey.="\0$coursedir"; - $inccourses{$1.'_'.$2}=1; - if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || - (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { - $allowed=1; - } - if ((&Apache::lonnet::allowed('dro',$1)) || - (&Apache::lonnet::allowed('dro',$ccdomain))) { - $delallowed=1; - } + $sortkey.="\0".$coursedata{'description'}; + $class=$coursedata{'type'}; + } else { + $carea=&mt('Unavailable course').': '.$area; + $sortkey.="\0".&mt('Unavailable course').': '.$area; + } + $sortkey.="\0$coursedir"; + $inccourses->{$1.'_'.$2}=1; + if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || + (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { + $allowed=1; + } + if ((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) { + $delallowed=1; + } # - custom role. Needs more info, too - if ($croletitle) { - if (&Apache::lonnet::allowed('ccr',$1.'/'.$2)) { - $allowed=1; - $thisrole.='.'.$role_code; - } - } - # Compute the background color based on $area - if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) { - $carea.='
Section: '.$3; - $sortkey.="\0$3"; - } - $area=$carea; - } else { - $sortkey.="\0".$area; - # Determine if current user is able to revoke privileges - if ($area=~m{^/($match_domain)/}) { - if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || + if ($croletitle) { + if (&Apache::lonnet::allowed('ccr',$1.'/'.$2)) { + $allowed=1; + $thisrole.='.'.$role_code; + } + } + # Compute the background color based on $area + if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) { + $carea.='
Section: '.$3; + $sortkey.="\0$3"; + if (!$allowed) { + if ($env{'request.course.sec'} eq $3) { + if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) { + $allowed = 1; + } + } + } + } + $area=$carea; + } else { + $sortkey.="\0".$area; + # Determine if current user is able to revoke privileges + if ($area=~m{^/($match_domain)/}) { + if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { - $allowed=1; - } - if (((&Apache::lonnet::allowed('dro',$1)) || - (&Apache::lonnet::allowed('dro',$ccdomain))) && - ($role_code ne 'dc')) { - $delallowed=1; - } - } else { - if (&Apache::lonnet::allowed('c'.$role_code,'/')) { - $allowed=1; - } - } - if ($role_code eq 'ca' || $role_code eq 'au') { - $class='Construction Space'; - } elsif ($role_code eq 'su') { - $class='System'; - } else { - $class='Domain'; - } - } - if (($role_code eq 'ca') || ($role_code eq 'aa')) { - $area=~m{/($match_domain)/($match_username)}; - if (&Apache::lonuserutils::authorpriv($2,$1)) { - $allowed=1; - } else { - $allowed=0; - } - } - my $row = ''; - $row.= ''; - my $active=1; - $active=0 if (($role_end_time) && ($now>$role_end_time)); - if (($active) && ($allowed)) { - $row.= ''; - } else { - if ($active) { - $row.=' '; - } else { - $row.=&mt('expired or revoked'); - } - } - $row.=''; - if ($allowed && !$active) { - $row.= ''; - } else { - $row.=' '; - } - $row.=''; - if ($delallowed) { - $row.= ''; - } else { + $allowed=1; + } + if (((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) && + ($role_code ne 'dc')) { + $delallowed=1; + } + } else { + if (&Apache::lonnet::allowed('c'.$role_code,'/')) { + $allowed=1; + } + } + if ($role_code eq 'ca' || $role_code eq 'au') { + $class='Construction Space'; + } elsif ($role_code eq 'su') { + $class='System'; + } else { + $class='Domain'; + } + } + if (($role_code eq 'ca') || ($role_code eq 'aa')) { + $area=~m{/($match_domain)/($match_username)}; + if (&Apache::lonuserutils::authorpriv($2,$1)) { + $allowed=1; + } else { + $allowed=0; + } + } + my $row = ''; + $row.= ''; + my $active=1; + $active=0 if (($role_end_time) && ($now>$role_end_time)); + if (($active) && ($allowed)) { + $row.= ''; + } else { + if ($active) { $row.=' '; - } - my $plaintext=''; - if (!$croletitle) { - $plaintext=&Apache::lonnet::plaintext($role_code,$class) - } else { - $plaintext= - "Customrole '$croletitle'
defined by $croleuname\@$croleudom"; - } - $row.= ''.$plaintext. - ''.$area. - ''.($role_start_time?localtime($role_start_time) - : ' ' ). - ''.($role_end_time ?localtime($role_end_time) - : ' ' ) - .""; - $sortrole{$sortkey}=$envkey; - $roletext{$envkey}=$row; - $roleclass{$envkey}=$class; - $rolepriv{$envkey}=$allowed; - #$r->print($row); - } # end of foreach (table building loop) - my $rolesdisplay = 0; - my %output = (); - foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') { - $output{$type} = ''; - foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { - if ( ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/ ) && ($rolepriv{$sortrole{$which}}) ) { - $output{$type}.= - &Apache::loncommon::start_data_table_row(). - $roletext{$sortrole{$which}}. - &Apache::loncommon::end_data_table_row(); - } - } - unless($output{$type} eq '') { - $output{$type} = ''. - "".&mt($type)."". - $output{$type}; - $rolesdisplay = 1; - } - } - if ($rolesdisplay == 1) { - $r->print(' + } else { + $row.=&mt('expired or revoked'); + } + } + $row.=''; + if ($allowed && !$active) { + $row.= ''; + } else { + $row.=' '; + } + $row.=''; + if ($delallowed) { + $row.= ''; + } else { + $row.=' '; + } + my $plaintext=''; + if (!$croletitle) { + $plaintext=&Apache::lonnet::plaintext($role_code,$class) + } else { + $plaintext= + "Customrole '$croletitle'
defined by $croleuname\@$croleudom"; + } + $row.= ''.$plaintext. + ''.$area. + ''.($role_start_time?localtime($role_start_time) + : ' ' ). + ''.($role_end_time ?localtime($role_end_time) + : ' ' ) + .""; + $sortrole{$sortkey}=$envkey; + $roletext{$envkey}=$row; + $roleclass{$envkey}=$class; + $rolepriv{$envkey}=$allowed; + #$r->print($row); + } # end of foreach (table building loop) + my $rolesdisplay = 0; + my %output = (); + foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') { + $output{$type} = ''; + foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { + if ( ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/ ) && ($rolepriv{$sortrole{$which}}) ) { + $output{$type}.= + &Apache::loncommon::start_data_table_row(). + $roletext{$sortrole{$which}}. + &Apache::loncommon::end_data_table_row(); + } + } + unless($output{$type} eq '') { + $output{$type} = ''. + "".&mt($type)."". + $output{$type}; + $rolesdisplay = 1; + } + } + if ($rolesdisplay == 1) { + $r->print('

'.$lt{'rer'}.'

'. &Apache::loncommon::start_data_table("LC_createuser"). &Apache::loncommon::start_data_table_header_row(). @@ -987,30 +1100,33 @@ ENDNOPORTPRIV ''.$lt{'rol'}.''.$lt{'ext'}. ''.$lt{'sta'}.''.$lt{'end'}.''. &Apache::loncommon::end_data_table_header_row()); - foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') { - if ($output{$type}) { - $r->print($output{$type}."\n"); - } - } - $r->print(&Apache::loncommon::end_data_table()); - } - } # End of unless - } ## End of new user/old user logic + foreach my $type ('Construction Space','Course','Group','Domain','System','Unknown') { + if ($output{$type}) { + $r->print($output{$type}."\n"); + } + } + $r->print(&Apache::loncommon::end_data_table()); + } + } # End of check for keys in rolesdump + return; +} + +sub new_coauthor_roles { + my ($r,$ccuname,$ccdomain) = @_; my $addrolesdisplay = 0; - $r->print('

'.&mt('Add Roles').'

'); -# -# Co-Author -# + # + # Co-Author + # if (&Apache::lonuserutils::authorpriv($env{'user.name'}, $env{'request.role.domain'}) && ($env{'user.name'} ne $ccuname || $env{'user.domain'} ne $ccdomain)) { # No sense in assigning co-author role to yourself $addrolesdisplay = 1; - my $cuname=$env{'user.name'}; + my $cuname=$env{'user.name'}; my $cudom=$env{'request.role.domain'}; - my %lt=&Apache::lonlocal::texthash( - 'cs' => "Construction Space", - 'act' => "Activate", + my %lt=&Apache::lonlocal::texthash( + 'cs' => "Construction Space", + 'act' => "Activate", 'rol' => "Role", 'ext' => "Extent", 'sta' => "Start", @@ -1019,16 +1135,16 @@ ENDNOPORTPRIV 'caa' => "Assistant Co-Author", 'ssd' => "Set Start Date", 'sed' => "Set End Date" - ); - $r->print('

'.$lt{'cs'}.'

'."\n". - &Apache::loncommon::start_data_table()."\n". - &Apache::loncommon::start_data_table_header_row()."\n". - ''.$lt{'act'}.''.$lt{'rol'}.''. - ''.$lt{'ext'}.''.$lt{'sta'}.''. - ''.$lt{'end'}.''."\n". - &Apache::loncommon::end_data_table_header_row()."\n". - &Apache::loncommon::start_data_table_row()."\n". - ' + ); + $r->print('

'.$lt{'cs'}.'

'."\n". + &Apache::loncommon::start_data_table()."\n". + &Apache::loncommon::start_data_table_header_row()."\n". + ''.$lt{'act'}.''.$lt{'rol'}.''. + ''.$lt{'ext'}.''.$lt{'sta'}.''. + ''.$lt{'end'}.''."\n". + &Apache::loncommon::end_data_table_header_row()."\n". + &Apache::loncommon::start_data_table_row().' + '.$lt{'cau'}.' @@ -1039,8 +1155,8 @@ ENDNOPORTPRIV '.$lt{'sed'}.''."\n". - &Apache::loncommon::end_data_table_row()."\n". - &Apache::loncommon::start_data_table_row()."\n". + &Apache::loncommon::end_data_table_row()."\n". + &Apache::loncommon::start_data_table_row()."\n". ' '.$lt{'caa'}.' '.$cudom.'_'.$cuname.' @@ -1050,24 +1166,30 @@ ENDNOPORTPRIV '.$lt{'sed'}.''."\n". - &Apache::loncommon::end_data_table_row()."\n". - &Apache::loncommon::end_data_table()); + &Apache::loncommon::end_data_table_row()."\n". + &Apache::loncommon::end_data_table()); } elsif ($env{'request.role'} =~ /^au\./) { if (!(&Apache::lonuserutils::authorpriv($env{'user.name'}, $env{'request.role.domain'}))) { $r->print(''. &mt('You do not have privileges to assign co-author roles.'). ''); - } elsif (($env{'user.name'} eq $ccuname) && + } elsif (($env{'user.name'} eq $ccuname) && ($env{'user.domain'} eq $ccdomain)) { - $r->print(&mt('Assigning yourself a co-author or assistant co-author role in your own author area in Construction Space is not permitted')); + $r->print(&mt('Assigning yourself a co-author or assistant co-author role in your own author area in Construction Space is not permitted')); } } -# -# Domain level -# + return $addrolesdisplay;; +} + +sub new_domain_roles { + my ($r) = @_; + my $addrolesdisplay = 0; + # + # Domain level + # my $num_domain_level = 0; - my $domaintext = + my $domaintext = '

'.&mt('Domain Level').'

'. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). @@ -1079,12 +1201,12 @@ ENDNOPORTPRIV foreach my $role ('dc','li','dg','au','sc') { if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) { my $plrole=&Apache::lonnet::plaintext($role); - my %lt=&Apache::lonlocal::texthash( + my %lt=&Apache::lonlocal::texthash( 'ssd' => "Set Start Date", 'sed' => "Set End Date" - ); + ); $num_domain_level ++; - $domaintext .= + $domaintext .= &Apache::loncommon::start_data_table_row(). ' '.$plrole.' @@ -1097,100 +1219,14 @@ ENDNOPORTPRIV "javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.''. &Apache::loncommon::end_data_table_row(); } - } + } } $domaintext.= &Apache::loncommon::end_data_table(); if ($num_domain_level > 0) { $r->print($domaintext); $addrolesdisplay = 1; } -# -# Course level -# - - if ($env{'request.role'} =~ m{^dc\./($match_domain)/$}) { - $r->print(&course_level_dc($1,'Course')); - $r->print('
'."\n"); - } elsif ($env{'request.role'} =~ m{^au\./($match_domain)/$}) { - if ($addrolesdisplay) { - $r->print('
print(' onClick="verify_message(this.form)" \>'."\n"); - } else { - $r->print('onClick="this.form.submit()" \>'."\n"); - } - } else { - $r->print('
'. - &mt('Back to previous page').''); - } - } else { - $r->print(&course_level_table(%inccourses)); - $r->print('
'."\n"); - } - $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); - $r->print(''); - $r->print(''); - $r->print("".&Apache::loncommon::end_page()); -} - -sub singleuser_breadcrumb { - my %breadcrumb_text; - if ($env{'form.action'} eq 'singlestudent') { - $breadcrumb_text{'search'} = 'Enroll a student'; - $breadcrumb_text{'userpicked'} = 'Select a user', - $breadcrumb_text{'modify'} = 'Set section/dates', - } else { - $breadcrumb_text{'search'} = 'Create/modify user'; - $breadcrumb_text{'userpicked'} = 'Select a user', - $breadcrumb_text{'modify'} = 'Set user role', - } - return %breadcrumb_text; -} - -sub date_sections_select { - my ($context,$newuser,$formname,$permission) = @_; - my $cid = $env{'request.course.id'}; - my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity($cid); - my $date_table = '

'.&mt('Starting and Ending Dates').'

'."\n". - &Apache::lonuserutils::date_setting_table(undef,undef,$context, - undef,$formname,$permission); - my $rowtitle = 'Section'; - my $secbox = '

'.&mt('Section').'

'."\n". - &Apache::lonuserutils::section_picker($cdom,$cnum,'st',$rowtitle, - $permission); - my $output = $date_table.$secbox; - return $output; -} - -sub validation_javascript { - my ($context,$ccdomain,$pjump_def,$groupslist,$newuser,$formname, - $loaditem) = @_; - my $dc_setcourse_code = ''; - my $nondc_setsection_code = ''; - if ($context eq 'domain') { - my $dcdom = $env{'request.role.domain'}; - $loaditem->{'onload'} = "document.cu.coursedesc.value='';"; - $dc_setcourse_code = &Apache::lonuserutils::dc_setcourse_js('cu','singleuser'); - } else { - $nondc_setsection_code = - &Apache::lonuserutils::setsections_javascript($formname,$groupslist); - } - my $js = &user_modification_js($pjump_def,$dc_setcourse_code, - $nondc_setsection_code,$groupslist); - - my ($jsback,$elements) = &crumb_utilities(); - my $javascript_validations; - if ((&Apache::lonnet::allowed('mau',$ccdomain)) || ($newuser)) { - my ($krbdef,$krbdefdom) = - &Apache::loncommon::get_kerberos_defaults($ccdomain); - $javascript_validations = - &Apache::lonuserutils::javascript_validations('createuser',$krbdefdom,undef, - undef,$ccdomain); - } - $js .= "\n". - ''; - return $js; + return $addrolesdisplay; } sub user_authentication {