'.$user_quota_text);
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&date_sections_select($context,$newuser,$formname));
+ }
+ } else {
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print('
'.
+ &date_sections_select($context,$newuser,$formname));
+ }
+ }
+ $r->print('
');
+ 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);
}
- $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 ($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 (&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().
@@ -1004,29 +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
-#
- if (&authorpriv($env{'user.name'},$env{'request.role.domain'}) &&
+ #
+ # 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",
@@ -1035,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'}.' |
@@ -1055,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.' |
@@ -1066,23 +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 (!(&authorpriv($env{'user.name'},$env{'request.role.domain'}))) {
+ 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().
@@ -1094,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.' |
@@ -1112,40 +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());
+ return $addrolesdisplay;
}
sub user_authentication {
@@ -1197,8 +1278,8 @@ $lt{'uuas'} ($currentauth). $lt{'adcs'}.
ENDBADAUTH
}
} else { # Authentication type is valid
- &initialize_authen_forms($ccdomain,$currentauth);
- my ($authformcurrent,$authform_other,$can_modify) =
+ &initialize_authen_forms($ccdomain,$currentauth,'modifyuser');
+ my ($authformcurrent,$can_modify,@authform_others) =
&modify_login_block($ccdomain,$currentauth);
if (&Apache::lonnet::allowed('mau',$ccdomain)) {
# Current user has login modification privileges
@@ -1222,13 +1303,15 @@ ENDBADAUTH
'
'.$authformcurrent.' | '.
&Apache::loncommon::end_data_table_row()."\n";
} else {
- $outcome .= ' ('.$authformcurrent.')';
+ $outcome .= ' ('.$authformcurrent.')'.
+ &Apache::loncommon::end_data_table_row()."\n";
}
- if ($authform_other ne '') {
- $outcome .= $authform_other;
+ foreach my $item (@authform_others) {
+ $outcome .= &Apache::loncommon::start_data_table_row().
+ '
'.$item.' | '.
+ &Apache::loncommon::end_data_table_row()."\n";
}
- $outcome .= &Apache::loncommon::end_data_table_row().
- &Apache::loncommon::end_data_table();
+ $outcome .= &Apache::loncommon::end_data_table();
} else {
if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
my %lt=&Apache::lonlocal::texthash(
@@ -1251,18 +1334,14 @@ sub modify_login_block {
my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$dom);
my ($authnum,%can_assign) =
&Apache::loncommon::get_assignable_auth($dom);
- my ($authformcurrent,$authform_other,$show_override_msg);
+ my ($authformcurrent,@authform_others,$show_override_msg);
if ($currentauth=~/^krb(4|5):/) {
$authformcurrent=$authformkrb;
if ($can_assign{'int'}) {
- $authform_other = &Apache::loncommon::start_data_table_row().
- '
'.$authformint.' | '.
- &Apache::loncommon::end_data_table_row()."\n"
+ push(@authform_others,$authformint);
}
if ($can_assign{'loc'}) {
- $authform_other .= &Apache::loncommon::start_data_table_row().
- '
'.$authformloc.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformloc);
}
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) {
$show_override_msg = 1;
@@ -1270,14 +1349,10 @@ sub modify_login_block {
} elsif ($currentauth=~/^internal:/) {
$authformcurrent=$authformint;
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) {
- $authform_other = &Apache::loncommon::start_data_table_row().
- '
'.$authformkrb.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformkrb);
}
if ($can_assign{'loc'}) {
- $authform_other .= &Apache::loncommon::start_data_table_row().
- '
'.$authformloc.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformloc);
}
if ($can_assign{'int'}) {
$show_override_msg = 1;
@@ -1285,19 +1360,13 @@ sub modify_login_block {
} elsif ($currentauth=~/^unix:/) {
$authformcurrent=$authformfsys;
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) {
- $authform_other = &Apache::loncommon::start_data_table_row().
- '
'.$authformkrb.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformkrb);
}
if ($can_assign{'int'}) {
- $authform_other .= &Apache::loncommon::start_data_table_row().
- '
'.$authformint.' | '.
- &Apache::loncommon::end_data_table_row()."\n"
+ push(@authform_others,$authformint);
}
if ($can_assign{'loc'}) {
- $authform_other .= &Apache::loncommon::start_data_table_row().
- '
'.$authformloc.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformloc);
}
if ($can_assign{'fsys'}) {
$show_override_msg = 1;
@@ -1305,35 +1374,38 @@ sub modify_login_block {
} elsif ($currentauth=~/^localauth:/) {
$authformcurrent=$authformloc;
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) {
- $authform_other = &Apache::loncommon::start_data_table_row().
- '
'.$authformkrb.' | '.
- &Apache::loncommon::end_data_table_row()."\n";
+ push(@authform_others,$authformkrb);
}
if ($can_assign{'int'}) {
- $authform_other .= &Apache::loncommon::start_data_table_row().
- '
'.$authformint.' | '.
- &Apache::loncommon::end_data_table_row()."\n"
+ push(@authform_others,$authformint);
}
if ($can_assign{'loc'}) {
$show_override_msg = 1;
}
}
if ($show_override_msg) {
- $authformcurrent.= '
'.
+ $authformcurrent = ''.$authformcurrent.
+ ' |
'."\n".
+ ' | '.
+ ''.&mt('Currently in use').' | '.
+ ''.
&mt('will override current values').
- ' ';
+ ' |
';
}
- return ($authformcurrent,$authform_other,$show_override_msg);
+ return ($authformcurrent,$show_override_msg,@authform_others);
}
sub personal_data_display {
- my ($ccuname,$ccdomain,$newuser,%inst_results) = @_;
- my ($output,%userenv);
+ my ($ccuname,$ccdomain,$newuser,$context,$inst_results) = @_;
+ my ($output,$showforceid,%userenv,%domconfig);
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
+ %domconfig =
+ &Apache::lonnet::get_dom('configuration',['usermodification'],
+ $ccdomain);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1365,27 +1437,57 @@ sub personal_data_display {
}
$output .= &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
if ($newuser) {
- if ($inst_results{$item} ne '') {
- $output .= ''.$inst_results{$item};
+ if (ref($inst_results) eq 'HASH') {
+ if ($inst_results->{$item} ne '') {
+ $output .= ''.$inst_results->{$item};
+ } else {
+ $output .= '';
+ }
} else {
$output .= '';
}
} else {
+ my $canmodify = 0;
if (&Apache::lonnet::allowed('mau',$ccdomain)) {
+ $canmodify = 1;
+ } else {
+ if (ref($domconfig{'usermodification'}) eq 'HASH') {
+ if (ref($domconfig{'usermodification'}{$context}) eq 'HASH') {
+ foreach my $key (keys(%{$domconfig{'usermodification'}{$context}})) {
+ if (ref($domconfig{'usermodification'}{$context}{$key}) eq 'HASH') {
+ if ($domconfig{'usermodification'}{$context}{$key}{$item}) {
+ $canmodify = 1;
+ last;
+ }
+ }
+ }
+ }
+ } elsif ($context eq 'course') {
+ $canmodify = 1;
+ }
+ }
+ if ($canmodify) {
$output .= '';
} else {
$output .= $userenv{$item};
}
+ if ($item eq 'id') {
+ $showforceid = $canmodify;
+ }
}
$output .= &Apache::lonhtmlcommon::row_closure(1);
}
$output .= &Apache::lonhtmlcommon::end_pick_box();
- return $output;
+ if (wantarray) {
+ return ($output,$showforceid);
+ } else {
+ return $output;
+ }
}
# ================================================================= Phase Three
sub update_user_data {
- my ($r) = @_;
+ my ($r,$context) = @_;
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -1400,20 +1502,20 @@ sub update_user_data {
} else {
$title='Modify User Privileges';
}
-
+ my $newuser = 0;
my ($jsback,$elements) = &crumb_utilities();
my $jscript = ''."\n";
-
+ my %breadcrumb_text = &singleuser_breadcrumb();
$r->print(&Apache::loncommon::start_page($title,$jscript));
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:backPage(document.userupdate)",
- text=>"Create/modify user",
+ text=>$breadcrumb_text{'search'},
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",
+ text=>$breadcrumb_text{'userpicked'},
faq=>282,bug=>'Instructor Interface',});
}
&Apache::lonhtmlcommon::add_breadcrumb
@@ -1573,6 +1675,10 @@ sub update_user_data {
}
}
##
+ my (@userroles,%userupdate,$cnum,$cdom,$namechanged);
+ if ($context eq 'course') {
+ ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
+ }
if (! $env{'form.makeuser'} ) {
# Check for need to change
my %userenv = &Apache::lonnet::get
@@ -1583,20 +1689,132 @@ sub update_user_data {
if ($tmp =~ /^(con_lost|error)/i) {
%userenv = ();
}
- # Check to see if we need to change user information
+ my $no_forceid_alert;
+ # Check to see if user information can be changed
+ my %domconfig =
+ &Apache::lonnet::get_dom('configuration',['usermodification'],
+ $env{'form.ccdomain'});
+ my @statuses = ('active','future');
+ my %roles = &Apache::lonnet::get_my_roles($env{'form.ccuname'},$env{'form.ccdomain'},'userroles',\@statuses,undef,$env{'request.role.domain'});
+ my ($auname,$audom);
+ if ($context eq 'course') {
+ $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ if ($cnum eq '' || $cdom eq '') {
+ my $cid = $env{'request.course.id'};
+ my %coursehash =
+ &Apache::lonnet::coursedescription($cid,{'one_time' => 1});
+ $cdom = $coursehash{'domain'};
+ $cnum = $coursehash{'num'};
+ }
+ } elsif ($context eq 'author') {
+ $auname = $env{'user.name'};
+ $audom = $env{'user.domain'};
+ }
+ foreach my $item (keys(%roles)) {
+ my ($rolenum,$roledom,$role) = split(/:/,$item);
+ if ($context eq 'course') {
+ if ($cnum ne '' && $cdom ne '') {
+ if ($rolenum eq $cnum && $roledom eq $cdom) {
+ if (!grep(/^\Q$role\E$/,@userroles)) {
+ push(@userroles,$role);
+ }
+ }
+ }
+ } elsif ($context eq 'author') {
+ if ($rolenum eq $auname && $roledom eq $audom) {
+ if (!grep(/^\Q$role\E$/,@userroles)) {
+ push(@userroles,$role);
+ }
+ }
+ }
+ }
+ # Check for course or co-author roles being activated or re-enabled
+ if ($context eq 'author' || $context eq 'course') {
+ foreach my $key (keys(%env)) {
+ if ($context eq 'author') {
+ if ($key=~/^form\.act_\Q$audom\E_\Q$auname\E_([^_]+)/) {
+ if (!grep(/^\Q$1\E$/,@userroles)) {
+ push(@userroles,$1);
+ }
+ } elsif ($key =~/^form\.ren\:\Q$audom\E\/\Q$auname\E_([^_]+)/) {
+ if (!grep(/^\Q$1\E$/,@userroles)) {
+ push(@userroles,$1);
+ }
+ }
+ } elsif ($context eq 'course') {
+ if ($key=~/^form\.act_\Q$cdom\E_\Q$cnum\E_([^_]+)/) {
+ if (!grep(/^\Q$1\E$/,@userroles)) {
+ push(@userroles,$1);
+ }
+ } elsif ($key =~/^form\.ren\:\Q$cdom\E\/\Q$cnum\E(\/?\w*)_([^_]+)/) {
+ if (!grep(/^\Q$1\E$/,@userroles)) {
+ push(@userroles,$1);
+ }
+ }
+ }
+ }
+ }
+ #Check to see if we can change personal data for the user
+ my (@mod_disallowed,@longroles);
+ foreach my $role (@userroles) {
+ if ($role eq 'cr') {
+ push(@longroles,'Custom');
+ } else {
+ push(@longroles,&Apache::lonnet::plaintext($role));
+ }
+ }
foreach my $item ('firstname','middlename','lastname','generation','permanentemail','id') {
+ my $canmodify = 0;
+ if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'})) {
+ $canmodify = 1;
+ } else {
+ if ($context eq 'course' || $context eq 'author') {
+ if (ref($domconfig{'usermodification'}) eq 'HASH') {
+ if (ref($domconfig{'usermodification'}{$context}) eq 'HASH') {
+ foreach my $role (@userroles) {
+ if (ref($domconfig{'usermodification'}{$context}{$role}) eq 'HASH') {
+ if ($domconfig{'usermodification'}{$context}{$role}{$item}) {
+ $canmodify = 1;
+ last;
+ }
+ }
+ }
+ }
+ }
+ } elsif ($context eq 'course') {
+ if (grep(/^st$/,@userroles)) {
+ $canmodify = 1;
+ }
+ }
+ }
# Strip leading and trailing whitespace
- $env{'form.c'.$item} =~ s/(\s+$|^\s+)//g;
+ $env{'form.c'.$item} =~ s/(\s+$|^\s+)//g;
+ if (!$canmodify) {
+ if (defined($env{'form.c'.$item})) {
+ if ($env{'form.c'.$item} ne $userenv{$item}) {
+ push(@mod_disallowed,$item);
+ }
+ }
+ $env{'form.c'.$item} = $userenv{$item};
+ }
}
# Check to see if we can change the ID/student number
my $forceid = $env{'form.forceid'};
my $recurseid = $env{'form.recurseid'};
my $newuser = 0;
- my $disallowed_id = 0;
my (%alerts,%rulematch,%idinst_results,%curr_rules,%got_rules);
- if (!$forceid) {
- $env{'form.cid'} = $userenv{'id'};
- } elsif ($env{'form.cid'} ne $userenv{'id'}) {
+ my %uidhash = &Apache::lonnet::idrget($env{'form.ccdomain'},
+ $env{'form.ccuname'});
+ if (($uidhash{$env{'form.ccuname'}}) &&
+ ($uidhash{$env{'form.ccuname'}}!~/error\:/) &&
+ (!$forceid)) {
+ if ($env{'form.cid'} ne $uidhash{$env{'form.ccuname'}}) {
+ $env{'form.cid'} = $userenv{'id'};
+ $no_forceid_alert = &mt('New student/employeeID does not match existing ID for this user.').'
'.&mt('Change is not permitted without checking the \'Force ID change\' checkbox on the previous page.').'
'."\n";
+ }
+ }
+ if ($env{'form.cid'} ne $userenv{'id'}) {
my $checkhash;
my $checks = { 'id' => 1 };
$checkhash->{$env{'form.ccuname'}.':'.$env{'form.ccdomain'}} =
@@ -1607,15 +1825,17 @@ sub update_user_data {
\%alerts,\%rulematch,\%idinst_results,\%curr_rules,\%got_rules);
if (ref($alerts{'id'}) eq 'HASH') {
if (ref($alerts{'id'}{$env{'form.ccdomain'}}) eq 'HASH') {
- $disallowed_id = 1;
+ $env{'form.cid'} = $userenv{'id'};
}
}
}
- my ($quotachanged,$namechanged,$oldportfolioquota,$newportfolioquota,
- $inststatus,$isdefault,$defquotatext);
+ my ($quotachanged,$oldportfolioquota,$newportfolioquota,
+ $inststatus,$oldisdefault,$newisdefault,$olddefquotatext,
+ $newdefquotatext);
my ($defquota,$settingstatus) =
&Apache::loncommon::default_quota($env{'form.ccdomain'},$inststatus);
my %changeHash;
+ $changeHash{'portfolioquota'} = $userenv{'portfolioquota'};
if ($userenv{'portfolioquota'} ne '') {
$oldportfolioquota = $userenv{'portfolioquota'};
if ($env{'form.customquota'} == 1) {
@@ -1625,15 +1845,16 @@ sub update_user_data {
$newportfolioquota = $env{'form.portfolioquota'};
$newportfolioquota =~ s/[^\d\.]//g;
}
- if ($newportfolioquota != $userenv{'portfolioquota'}) {
+ if ($newportfolioquota != $oldportfolioquota) {
$quotachanged = "a_admin($newportfolioquota,\%changeHash);
}
} else {
$quotachanged = "a_admin('',\%changeHash);
$newportfolioquota = $defquota;
- $isdefault = 1;
+ $newisdefault = 1;
}
} else {
+ $oldisdefault = 1;
$oldportfolioquota = $defquota;
if ($env{'form.customquota'} == 1) {
if ($env{'form.portfolioquota'} eq '') {
@@ -1645,43 +1866,47 @@ sub update_user_data {
$quotachanged = "a_admin($newportfolioquota,\%changeHash);
} else {
$newportfolioquota = $defquota;
- $isdefault = 1;
+ $newisdefault = 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 ($oldisdefault) {
+ $olddefquotatext = &get_defaultquota_text($settingstatus);
+ }
+ if ($newisdefault) {
+ $newdefquotatext = &get_defaultquota_text($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.cid'} ne $userenv{'id'} ||
- $env{'form.cpermanentemail'} ne $userenv{'permanentemail'} )) {
+ if ($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.cid'} ne $userenv{'id'} ||
+ $env{'form.cpermanentemail'} ne $userenv{'permanentemail'} ) {
$namechanged = 1;
}
- if ($namechanged) {
- # Make the change
+ if ($namechanged || $quotachanged) {
$changeHash{'firstname'} = $env{'form.cfirstname'};
$changeHash{'middlename'} = $env{'form.cmiddlename'};
$changeHash{'lastname'} = $env{'form.clastname'};
$changeHash{'generation'} = $env{'form.cgeneration'};
$changeHash{'id'} = $env{'form.cid'};
$changeHash{'permanentemail'} = $env{'form.cpermanentemail'};
- my $putresult = &Apache::lonnet::put
- ('environment',\%changeHash,
- $env{'form.ccdomain'},$env{'form.ccuname'});
- if ($putresult eq 'ok') {
+ my ($quotachgresult,$namechgresult);
+ if ($quotachanged) {
+ $quotachgresult =
+ &Apache::lonnet::put('environment',\%changeHash,
+ $env{'form.ccdomain'},$env{'form.ccuname'});
+ }
+ if ($namechanged) {
+ # Make the change
+ $namechgresult =
+ &Apache::lonnet::modifyuser($env{'form.ccdomain'},
+ $env{'form.ccuname'},$changeHash{'id'},undef,undef,
+ $changeHash{'firstname'},$changeHash{'middlename'},
+ $changeHash{'lastname'},$changeHash{'generation'},
+ $changeHash{'id'},undef,$changeHash{'permanentemail'});
+ }
+ if (($namechanged && $namechgresult eq 'ok') ||
+ ($quotachanged && $quotachgresult eq 'ok')) {
# Tell the user we changed the name
my %lt=&Apache::lonlocal::texthash(
'uic' => "User Information Changed",
@@ -1695,48 +1920,63 @@ sub update_user_data {
'prvs' => "Previous",
'chto' => "Changed To"
);
+ $r->print(''.$lt{'uic'}.'
'.
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row());
$r->print(<<"END");
-
-$lt{'uic'}
- |
+ |
$lt{'frst'} |
$lt{'mddl'} |
$lt{'lst'} |
$lt{'gen'} |
$lt{'id'} |
$lt{'mail'} |
- $lt{'disk'} |
-$lt{'prvs'} |
+ $lt{'disk'} |
+END
+ $r->print(&Apache::loncommon::end_data_table_header_row().
+ &Apache::loncommon::start_data_table_row());
+ $r->print(<<"END");
+ $lt{'prvs'} |
$userenv{'firstname'} |
$userenv{'middlename'} |
$userenv{'lastname'} |
$userenv{'generation'} |
$userenv{'id'} |
$userenv{'permanentemail'} |
- $oldportfolioquota Mb |
-
-$lt{'chto'} |
+ $oldportfolioquota Mb $olddefquotatext |
+END
+ $r->print(&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row());
+ $r->print(<<"END");
+ $lt{'chto'} |
$env{'form.cfirstname'} |
$env{'form.cmiddlename'} |
$env{'form.clastname'} |
$env{'form.cgeneration'} |
$env{'form.cid'} |
$env{'form.cpermanentemail'} |
- $newportfolioquota Mb $defquotatext |
-
+ $newportfolioquota Mb $newdefquotatext |
END
- if (($forceid) && ($recurseid) && (!$disallowed_id) &&
- (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
- my %userupdate = (
+ $r->print(&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table().'
');
+ if ($env{'form.cid'} ne $userenv{'id'}) {
+ &Apache::lonnet::idput($env{'form.ccdomain'},
+ ($env{'form.ccuname'} => $env{'form.cid'}));
+ if (($recurseid) &&
+ (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
+ %userupdate = (
lastname => $env{'form.clasaname'},
middlename => $env{'form.cmiddlename'},
firstname => $env{'form.cfirstname'},
generation => $env{'fora.cgeneration'},
id => $env{'form.cid'},
);
- my $idresult = &propagate_id_change($env{'form.ccname'},
- $env{'form.ccdomain'},\%userupdate);
- $r->print('
'.$idresult.'
');
+ my $idresult =
+ &Apache::lonuserutils::propagate_id_change(
+ $env{'form.ccuname'},$env{'form.ccdomain'},
+ \%userupdate);
+ $r->print('
'.$idresult.'
');
+ }
}
if (($env{'form.ccdomain'} eq $env{'user.domain'}) &&
($env{'form.ccuname'} eq $env{'user.name'})) {
@@ -1749,17 +1989,11 @@ END
} else { # error occurred
$r->print('
'.&mt('Unable to successfully change environment for').' '.
$env{'form.ccuname'}.' '.&mt('in domain').' '.
- $env{'form.ccdomain'}.'');
+ $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
+ # They did not want to change the users name or quota but we can
+ # still tell them what the name and quota are
my %lt=&Apache::lonlocal::texthash(
'id' => "ID/Student number",
'mail' => "Permanent e-mail",
@@ -1768,20 +2002,41 @@ END
$r->print(<<"END");
$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} $userenv{'generation'}
END
- if ($userenv{'permanentemail'} eq '') {
- $r->print('
');
+ if ($userenv{'permanentemail'} ne '') {
+ $r->print('
['.$lt{'mail'}.': '.
+ $userenv{'permanentemail'}.']');
+ }
+ $r->print('
['.$lt{'disk'}.': '.$oldportfolioquota.' Mb '.
+ $olddefquotatext.']');
+ }
+ if (@mod_disallowed) {
+ my ($rolestr,$contextname);
+ if (@longroles > 0) {
+ $rolestr = join(', ',@longroles);
} else {
- $r->print(' ('.$lt{'mail'}.': '.
- $userenv{'permanentemail'}.')');
+ $rolestr = &mt('No roles');
}
- if ($putresult eq 'ok') {
- if ($oldportfolioquota != $newportfolioquota) {
- $r->print('
'.$lt{'disk'}.': '.$newportfolioquota.' Mb '.
- $defquotatext.'
');
- &Apache::lonnet::appenv('environment.portfolioquota' => $changeHash{'portfolioquota'});
- }
+ if ($context eq 'course') {
+ $contextname = &mt('course');
+ } elsif ($context eq 'author') {
+ $contextname = &mt('co-author');
+ }
+ $r->print(&mt('The following fields were not updated: ').'
');
+ my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles();
+ foreach my $field (@mod_disallowed) {
+ $r->print('- '.$fieldtitles{$field}.'
'."\n");
+ }
+ $r->print('
');
+ if (@mod_disallowed == 1) {
+ $r->print(&mt("You do not have the authority to change this field given the user's current set of active/future [_1] roles:",$contextname));
+ } else {
+ $r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future [_1] roles:",$contextname));
}
+ $r->print('
'.$rolestr.''.
+ &mt('Contact your
helpdesk for more information.',"javascript:helpMenu('display')").'
');
}
+ $r->print($no_forceid_alert.
+ &Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts, \%curr_rules));
}
##
my $now=time;
@@ -1802,10 +2057,10 @@ END
$r->print(&mt('Revoking [_1] in [_2]: [_3]',
$role,$scope,'
'.$result.'').'
');
if ($role eq 'st') {
- my $result =
+ my $result =
&Apache::lonuserutils::classlist_drop($scope,
$env{'form.ccuname'},$env{'form.ccdomain'},
- $now);
+ $now);
$r->print($result);
}
}
@@ -1829,10 +2084,10 @@ END
$r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope,
'
'.$result.'').'
');
if ($role eq 'st') {
- my $result =
+ my $result =
&Apache::lonuserutils::classlist_drop($scope,
$env{'form.ccuname'},$env{'form.ccdomain'},
- $now);
+ $now);
$r->print($result);
}
}
@@ -2009,6 +2264,23 @@ END
$r->print(&Apache::loncommon::end_page());
}
+sub get_defaultquota_text {
+ my ($settingstatus) = @_;
+ my $defquotatext;
+ 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});
+ }
+ }
+ return $defquotatext;
+}
+
sub update_result_form {
my ($uhome) = @_;
my $outcome =
@@ -2016,6 +2288,9 @@ sub update_result_form {
foreach my $item ('srchby','srchin','srchtype','srchterm','srchdomain','ccuname','ccdomain') {
$outcome .= '
'."\n";
}
+ if ($env{'form.origname'} ne '') {
+ $outcome .= '
'."\n";
+ }
foreach my $item ('sortby','seluname','seludom') {
if (exists($env{'form.'.$item})) {
$outcome .= '
'."\n";
@@ -2374,17 +2649,20 @@ sub handler {
if ($env{'request.course.id'}) {
$context = 'course';
} elsif ($env{'request.role'} =~ /^au\./) {
- $context = 'construction_space';
+ $context = 'author';
} else {
$context = 'domain';
}
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['action','state']);
+ ['action','state','callingform','roletype','showrole','bulkaction']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/createuser",
- text=>"User Management"});
- my ($permission,$allowed) = &get_permission($context);
+ if ($env{'form.action'} ne 'dateselect') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/createuser",
+ text=>"User Management"});
+ }
+ my ($permission,$allowed) =
+ &Apache::lonuserutils::get_permission($context);
if (!$allowed) {
$env{'user.error.msg'}=
"/adm/createuser:cst:0:0:Cannot create/modify user data ".
@@ -2399,7 +2677,7 @@ sub handler {
if (! exists($env{'form.action'})) {
$r->print(&header());
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
- $r->print(&print_main_menu($permission));
+ $r->print(&print_main_menu($permission,$context));
$r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'upload' && $permission->{'cusr'}) {
$r->print(&header());
@@ -2423,22 +2701,8 @@ sub handler {
&Apache::lonuserutils::print_first_users_upload_form($r,$context);
}
$r->print(''.&Apache::loncommon::end_page());
- } elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=expire',
- text=>"Expire User Roles"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Expire User Roles',
- 'User_Management_Drops'));
- if (! exists($env{'form.state'})) {
- &Apache::lonuserutils::print_expire_menu($r,$context);
- } elsif ($env{'form.state'} eq 'done') {
- &Apache::lonuserutils::expire_user_list($r);
- } else {
- &Apache::lonuserutils::print_expire_menu($r,$context);
- }
- $r->print(&Apache::loncommon::end_page());
- } elsif ($env{'form.action'} eq 'singleuser' && $permission->{'cusr'}) {
+ } elsif ((($env{'form.action'} eq 'singleuser') || ($env{'form.action'}
+ eq 'singlestudent')) && ($permission->{'cusr'})) {
my $phase = $env{'form.phase'};
my @search = ('srchterm','srchby','srchin','srchtype','srchdomain');
&Apache::loncreateuser::restore_prev_selections();
@@ -2447,16 +2711,34 @@ sub handler {
$srch->{$item} = $env{'form.'.$item};
}
- if (($phase eq 'get_user_info') || ($phase eq 'userpicked')) {
- if ($env{'form.phase'} eq 'get_user_info') {
+ if (($phase eq 'get_user_info') || ($phase eq 'userpicked') ||
+ ($phase eq 'createnewuser')) {
+ if ($env{'form.phase'} eq 'createnewuser') {
+ my $response;
+ if ($env{'form.srchterm'} !~ /^$match_username$/) {
+ my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
+ &print_username_entry_form($r,$context,$response,$srch);
+ } else {
+ my $ccuname =&LONCAPA::clean_username($srch->{'srchterm'});
+ my $ccdomain=&LONCAPA::clean_domain($srch->{'srchdomain'});
+ &print_user_modification_page($r,$ccuname,$ccdomain,
+ $srch,$response,$context);
+ }
+ } elsif ($env{'form.phase'} eq 'get_user_info') {
my ($currstate,$response,$forcenewuser,$results) =
&user_search_result($srch);
if ($env{'form.currstate'} eq 'modify') {
$currstate = $env{'form.currstate'};
}
if ($currstate eq 'select') {
+ my $operation;
+ if ($env{'form.action'} eq 'singleuser') {
+ $operation = 'createuser';
+ } elsif ($env{'form.action'} eq 'singlestudent') {
+ $operation = 'enrollstudent';
+ }
&print_user_selection_page($r,$response,$srch,$results,
- 'createuser',\@search);
+ $operation,\@search,$context);
} elsif ($currstate eq 'modify') {
my ($ccuname,$ccdomain);
if (($srch->{'srchby'} eq 'uname') &&
@@ -2477,7 +2759,7 @@ sub handler {
} elsif ($currstate eq 'query') {
&print_user_query_page($r,'createuser');
} else {
- &print_username_entry_form($r,$response,$srch,
+ &print_username_entry_form($r,$context,$response,$srch,
$forcenewuser);
}
} elsif ($env{'form.phase'} eq 'userpicked') {
@@ -2487,9 +2769,9 @@ sub handler {
$context);
}
} elsif ($env{'form.phase'} eq 'update_user_data') {
- &update_user_data($r);
+ &update_user_data($r,$context);
} else {
- &print_username_entry_form($r,undef,$srch);
+ &print_username_entry_form($r,$context,undef,$srch);
}
} elsif ($env{'form.action'} eq 'custom' && $permission->{'custom'}) {
if ($env{'form.phase'} eq 'set_custom_roles') {
@@ -2497,62 +2779,94 @@ sub handler {
} else {
&custom_role_editor($r);
}
- } elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) {
- my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);
- my $formname = 'studentform';
- if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
- ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) =
- &Apache::lonuserutils::courses_selector($env{'request.role.domain'},
- $formname);
- my $js = &add_script($jscript).$cb_jscript;
- my $loadcode =
- &Apache::lonuserutils::course_selector_loadcode($formname);
- if ($loadcode ne '') {
- $r->print(&header($js,{'onload' => $loadcode,}));
+ } elsif (($env{'form.action'} eq 'listusers') &&
+ ($permission->{'view'} || $permission->{'cusr'})) {
+ if ($env{'form.phase'} eq 'bulkchange') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'backPage(document.studentform)',
+ text=>"List Users"});
+ my $setting = $env{'form.roletype'};
+ my $choice = $env{'form.bulkaction'};
+ $r->print(&header());
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
+ 'User_Management_List'));
+ if ($permission->{'cusr'}) {
+ &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice);
+ }
+ } else {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/createuser?action=listusers',
+ text=>"List Users"});
+ my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);
+ my $formname = 'studentform';
+ if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
+ ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) =
+ &Apache::lonuserutils::courses_selector($env{'request.role.domain'},
+ $formname);
+ $jscript .= &verify_user_display();
+ my $js = &add_script($jscript).$cb_jscript;
+ my $loadcode =
+ &Apache::lonuserutils::course_selector_loadcode($formname);
+ if ($loadcode ne '') {
+ $r->print(&header($js,{'onload' => $loadcode,}));
+ } else {
+ $r->print(&header($js));
+ }
} else {
- $r->print(&header($js));
+ $r->print(&header(&add_script(&verify_user_display())));
}
- } else {
- $r->print(&header());
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
+ 'User_Management_List'));
+ &Apache::lonuserutils::print_userlist($r,undef,$permission,$context,
+ $formname,$totcodes,$codetitles,$idlist,$idlist_titles);
+ $r->print(&Apache::loncommon::end_page());
}
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=listusers',
- text=>"List Users"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
- 'User_Management_List'));
- &Apache::lonuserutils::print_userlist($r,undef,$permission,$context,
- $formname,$totcodes,$codetitles,$idlist,$idlist_titles);
- $r->print(&Apache::loncommon::end_page());
- } elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) {
+ } elsif ($env{'form.action'} eq 'drop' && $permission->{'cusr'}) {
$r->print(&header());
&Apache::lonhtmlcommon::add_breadcrumb
({href=>'/adm/createuser?action=drop',
- text=>"Expire Users"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Expire User Roles',
- 'User_Management_Drops'));
- if (! exists($env{'form.state'})) {
- &Apache::lonuserutils::print_expire_menu($r,$context);
+ text=>"Drop Students"});
+ if (!exists($env{'form.state'})) {
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Drop Students',
+ 'Course_Drop_Student'));
+
+ &Apache::lonuserutils::print_drop_menu($r,$context,$permission);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonuserutiles::expire_user_list($r);
- } else {
- &print_expire_menu($r,$context);
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/createuser?action=drop',
+ text=>"Result"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Drop Students',
+ 'Course_Drop_Student'));
+ &Apache::lonuserutils::update_user_list($r,$context,undef,
+ $env{'form.action'});
}
$r->print(&Apache::loncommon::end_page());
+ } elsif ($env{'form.action'} eq 'dateselect') {
+ if ($permission->{'cusr'}) {
+ $r->print(&header(undef,undef,{'no_nav_bar' => 1}).
+ &Apache::lonuserutils::date_section_selector($context).
+ &Apache::loncommon::end_page());
+ } else {
+ $r->print(&header().
+ '
'.&mt('You do not have permission to modify dates or sections for users').''.
+ &Apache::loncommon::end_page());
+ }
} else {
$r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); $r->print(&print_main_menu($permission));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $r->print(&print_main_menu($permission,$context));
$r->print(&Apache::loncommon::end_page());
}
return OK;
}
sub header {
- my ($jscript,$loaditems) = @_;
+ my ($jscript,$loaditems,$args) = @_;
my $start_page;
if (ref($loaditems) eq 'HASH') {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems,});
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
} else {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript);
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
}
return $start_page;
}
@@ -2562,39 +2876,98 @@ sub add_script {
return '';
}
+sub verify_user_display {
+ my $output = <<"END";
+
+function display_update() {
+ document.studentform.action.value = 'listusers';
+ document.studentform.phase.value = 'display';
+ document.studentform.submit();
+}
+
+END
+ return $output;
+
+}
+
###############################################################
###############################################################
# Menu Phase One
sub print_main_menu {
- my ($permission) = @_;
+ my ($permission,$context) = @_;
+ my %links = (
+ domain => {
+ upload => 'Upload a File of Users',
+ singleuser => 'Add/Manage a Single User',
+ listusers => 'Manage Multiple Users',
+ },
+ author => {
+ upload => 'Upload a File of Co-authors',
+ singleuser => 'Add/Manage a Single Co-author',
+ listusers => 'Display Co-authors and Manage Multiple Users',
+ },
+ course => {
+ upload => 'Upload a File of Course Users',
+ singleuser => 'Add/Manage a Single Course User',
+ listusers => 'Display Class Lists and Manage Multiple Users',
+ },
+ );
my @menu =
(
- { text => 'Upload a File of Users to Modify/Create Users and/or Add roles',
+ { text => $links{$context}{'upload'},
help => 'User_Management_Upload',
action => 'upload',
permission => $permission->{'cusr'},
},
- { text => 'Create User/Set User Roles for a single user',
+ { text => $links{$context}{'singleuser'},
help => 'User_Management_Single_User',
action => 'singleuser',
permission => $permission->{'cusr'},
},
- { text => 'Display Lists of Users',
+ { text => $links{$context}{'listusers'},
help => 'User_Management_List',
action => 'listusers',
- permission => $permission->{'view'},
- },
-# { text => 'Expire User Roles',
-# help => 'User_Management_Drops',
-# action => 'expire',
-# permission => $permission->{'cusr'},
-# },
- { text => 'Edit Custom Roles',
- help => 'Custom_Role_Edit',
- action => 'custom',
- permission => $permission->{'custom'},
+ permission => ($permission->{'view'} || $permission->{'cusr'}),
},
);
+ if ($context eq 'domain' || $context eq 'course') {
+ my $customlink = { text => 'Edit Custom Roles',
+ help => 'Custom_Role_Edit',
+ action => 'custom',
+ permission => $permission->{'custom'},
+ };
+ push(@menu,$customlink);
+ }
+ if ($context eq 'course') {
+ my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
+ my @courselinks =
+ (
+ { text => 'Enroll a Single Student',
+ help => 'Course_Single_Student',
+ action => 'singlestudent',
+ permission => $permission->{'cusr'},
+ },
+ { text => 'Drop Students',
+ help => 'Course_Drop_Student',
+ action => 'drop',
+ permission => $permission->{'cusr'},
+ });
+ if (!exists($permission->{'cusr_section'})) {
+ push(@courselinks,
+ { text => 'Automated Student Enrollment Manager',
+ permission => (&Apache::lonnet::auto_run($cnum,$cdom)
+ && $permission->{'cusr'}),
+ url => '/adm/populate',
+ });
+ }
+ push(@courselinks,
+ { text => 'Manage Course Groups',
+ help => 'Course_Manage_Group',
+ permission => $permission->{'grp_manage'},
+ url => '/adm/coursegroups?refpage=cusr',
+ });
+ push(@menu,@courselinks);
+ }
my $menu_html = '';
foreach my $menu_item (@menu) {
next if (! $menu_item->{'permission'});
@@ -2616,57 +2989,6 @@ sub print_main_menu {
return $menu_html;
}
-sub get_permission {
- my ($context) = @_;
- my %permission;
- if ($context eq 'course') {
- if ((&Apache::lonnet::allowed('cta',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('cin',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('ccr',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('cep',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('cst',$env{'request.course.id'}))) {
- $permission{'cusr'} = 1;
- $permission{'view'} =
- &Apache::lonnet::allowed('vcl',$env{'request.course.id'});
-
- }
- if (&Apache::lonnet::allowed('ccr',$env{'request.course.id'})) {
- $permission{'custom'} = 1;
- }
- if (&Apache::lonnet::allowed('vcl',$env{'request.course.id'})) {
- $permission{'view'} = 1;
- if (!$permission{'view'}) {
- my $scope = $env{'request.course.id'}.'/'.$env{'request.course.sec'};
- $permission{'view'} = &Apache::lonnet::allowed('vcl',$scope);
- if ($permission{'view'}) {
- $permission{'view_section'} = $env{'request.course.sec'};
- }
- }
- }
- } elsif ($context eq 'construction_space') {
- $permission{'cusr'} = &authorpriv($env{'user.name'},$env{'request.role.domain'});
- $permission{'view'} = $permission{'cusr'};
- } else {
- if ((&Apache::lonnet::allowed('cad',$env{'request.role.domain'})) ||
- (&Apache::lonnet::allowed('cli',$env{'request.role.domain'})) ||
- (&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
- (&Apache::lonnet::allowed('csc',$env{'request.role.domain'})) ||
- (&Apache::lonnet::allowed('cdg',$env{'request.role.domain'})) ||
- (&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) {
- $permission{'cusr'} = 1;
- }
- if (&Apache::lonnet::allowed('ccr',$env{'request.role.domain'})) {
- $permission{'custom'} = 1;
- }
- $permission{'view'} = $permission{'cusr'};
- }
- my $allowed = 0;
- foreach my $perm (values(%permission)) {
- if ($perm) { $allowed=1; last; }
- }
- return (\%permission,$allowed);
-}
-
sub restore_prev_selections {
my %saveable_parameters = ('srchby' => 'scalar',
'srchin' => 'scalar',
@@ -3069,6 +3391,10 @@ sub crumb_utilities {
srchtype => 'selectbox',
srchdomain => 'selectbox',
},
+ crtusername => {
+ srchterm => 'text',
+ srchdomain => 'selectbox',
+ },
docustom => {
rolename => 'selectbox',
newrolename => 'textbox',
@@ -3084,8 +3410,18 @@ sub crumb_utilities {
my $jsback .= qq|
function backPage(formname,prevphase,prevstate) {
- formname.phase.value = prevphase;
- formname.currstate.value = prevstate;
+ if (typeof prevphase == 'undefined') {
+ formname.phase.value = '';
+ }
+ else {
+ formname.phase.value = prevphase;
+ }
+ if (typeof prevstate == 'undefined') {
+ formname.currstate.value = '';
+ }
+ else {
+ formname.currstate.value = prevstate;
+ }
formname.submit();
}
|;
@@ -3127,7 +3463,8 @@ sub course_level_table {
&Apache::loncommon::get_sections($domain,$cnum);
}
}
- foreach my $role ('st','ta','ep','in','cc') {
+ my @roles = &Apache::lonuserutils::roles_by_context('course');
+ foreach my $role (@roles) {
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) {
my $plrole=&Apache::lonnet::plaintext($role);
$table .= &Apache::loncommon::start_data_table_row().
@@ -3136,9 +3473,9 @@ sub course_level_table {
'.$area.' Domain: '.$domain.' | '."\n";
if ($role ne 'cc') {
if (%sections_count) {
- my $currsec =
+ my $currsec =
&Apache::lonuserutils::course_sections(\%sections_count,
- $protectedcourse.'_'.$role);
+ $protectedcourse.'_'.$role);
$table .=
'
'.
'
@@ -3178,7 +3515,7 @@ ENDTIMEENTRY
'.$plrole.' |
'.$area.' | '."\n";
if (%sections_count) {
- my $currsec =
+ my $currsec =
&Apache::lonuserutils::course_sections(\%sections_count,
$customrole);
$table.=
@@ -3227,6 +3564,7 @@ $table.
sub course_level_dc {
my ($dcdom) = @_;
my %customroles=&Apache::lonuserutils::my_custom_roles();
+ my @roles = &Apache::lonuserutils::roles_by_context('course');
my $hiddenitems = ''.
''.
'';
@@ -3251,7 +3589,7 @@ sub course_level_dc {
my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
' | '."\n".
' | |