version 1.406.2.5, 2016/10/22 17:57:54
|
version 1.406.2.6, 2016/11/11 02:13:51
|
Line 160 END_SCRIPT
|
Line 160 END_SCRIPT
|
'<h3>'.$lt{'usrt'}.'</h3>'."\n". |
'<h3>'.$lt{'usrt'}.'</h3>'."\n". |
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
|
|
if (&Apache::lonnet::allowed('mut',$ccdomain)) { |
if ((&Apache::lonnet::allowed('mut',$ccdomain)) || |
|
(&Apache::lonnet::allowed('udp',$ccdomain))) { |
$output .= &build_tools_display($ccuname,$ccdomain,'tools'); |
$output .= &build_tools_display($ccuname,$ccdomain,'tools'); |
} |
} |
|
|
Line 265 sub build_tools_display {
|
Line 266 sub build_tools_display {
|
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
%domconfig = |
%domconfig = |
&Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); |
&Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); |
$isadv = &Apache::lonnet::is_advanced_user($ccuname,$ccdomain); |
$isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname); |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'requestauthor'); |
'requestauthor'); |
Line 426 sub build_tools_display {
|
Line 427 sub build_tools_display {
|
} |
} |
$output .= ' <td'.$colspan.'>'.$custom_access.(' 'x4). |
$output .= ' <td'.$colspan.'>'.$custom_access.(' 'x4). |
$lt{'avai'}.': '.$currdisp.'</td>'."\n". |
$lt{'avai'}.': '.$currdisp.'</td>'."\n". |
&Apache::loncommon::end_data_table_row()."\n". |
&Apache::loncommon::end_data_table_row()."\n"; |
|
unless (&Apache::lonnet::allowed('udp',$ccdomain)) { |
|
$output .= |
&Apache::loncommon::start_data_table_row()."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
' <td style="vertical-align:top;"><span class="LC_nobreak">'. |
' <td style="vertical-align:top;"><span class="LC_nobreak">'. |
$lt{'chse'}.': <label>'. |
$lt{'chse'}.': <label>'. |
Line 435 sub build_tools_display {
|
Line 438 sub build_tools_display {
|
'<label><input type="radio" name="custom'.$item.'" value="1" '. |
'<label><input type="radio" name="custom'.$item.'" value="1" '. |
$cust_on.'/>'.$lt{'uscu'}.'</label>'.$custradio.'</td>'. |
$cust_on.'/>'.$lt{'uscu'}.'</label>'.$custradio.'</td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
|
} |
} |
} |
return $output; |
return $output; |
} |
} |
Line 532 sub domadhocroles {
|
Line 536 sub domadhocroles {
|
my $confname = &Apache::lonnet::get_domainconfiguser($env{'request.role.domain'}); |
my $confname = &Apache::lonnet::get_domainconfiguser($env{'request.role.domain'}); |
my %existing=&Apache::lonnet::dump('roles',$env{'request.role.domain'}, |
my %existing=&Apache::lonnet::dump('roles',$env{'request.role.domain'}, |
$confname,'rolesdef_'); |
$confname,'rolesdef_'); |
my $output; |
my ($output,$canmodify); |
|
if (&Apache::lonnet::allowed('cdh',$env{'request.role.domain'})) { |
|
$canmodify = 1; |
|
} |
if (keys(%existing) > 0) { |
if (keys(%existing) > 0) { |
my @current; |
my @current; |
my $curradhoc = 'adhocroles.'.$env{'request.role.domain'}; |
my $curradhoc = 'adhocroles.'.$env{'request.role.domain'}; |
Line 540 sub domadhocroles {
|
Line 547 sub domadhocroles {
|
if ($userenv{$curradhoc}) { |
if ($userenv{$curradhoc}) { |
@current = split(/,/,$userenv{$curradhoc}); |
@current = split(/,/,$userenv{$curradhoc}); |
} |
} |
|
if (!$canmodify && !@current) { |
|
return; |
|
} |
my %customroles; |
my %customroles; |
foreach my $key (keys(%existing)) { |
foreach my $key (keys(%existing)) { |
if ($key=~/^rolesdef\_(\w+)$/) { |
if ($key=~/^rolesdef\_(\w+)$/) { |
Line 553 sub domadhocroles {
|
Line 563 sub domadhocroles {
|
&mt('Ad Hoc Course Roles Selectable via Helpdesk Role'). |
&mt('Ad Hoc Course Roles Selectable via Helpdesk Role'). |
'</h3>'."\n". |
'</h3>'."\n". |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(); |
'<th>'.&mt('Action').'</th><th>'.&mt('Role').'</th>'. |
if ($canmodify) { |
'<th>'.&mt('Privileges in Course').'<th>'. |
$output .= '<th>'.&mt('Action').'</th>'; |
&Apache::loncommon::end_data_table_header_row(); |
} |
|
$output .= '<th>'.&mt('Role').'</th>'. |
|
'<th>'.&mt('Privileges in Course').'<th>'. |
|
&Apache::loncommon::end_data_table_header_row(); |
foreach my $key (sort(keys(%customroles))) { |
foreach my $key (sort(keys(%customroles))) { |
|
next if ((!$canmodify) && (!grep(/^\Q$key\E$/,@current))); |
$output .= &Apache::loncommon::start_data_table_row(); |
$output .= &Apache::loncommon::start_data_table_row(); |
if (grep(/^\Q$key\E$/,@current)) { |
if ($canmodify) { |
$output .= '<td><label>'. |
if (grep(/^\Q$key\E$/,@current)) { |
'<input type="checkbox" name="adhocroledel" value="'.$key.'" />'. |
$output .= '<td><label>'. |
&mt('Delete').'</label>'. |
'<input type="checkbox" name="adhocroledel" value="'.$key.'" />'. |
'</td>'; |
&mt('Delete').'</label>'. |
} else { |
'</td>'; |
$output .= '<td><label>'. |
} else { |
'<input type="checkbox" name="adhocroleadd" value="'.$key.'" />'. |
$output .= '<td><label>'. |
&mt('Add').'</label>'. |
'<input type="checkbox" name="adhocroleadd" value="'.$key.'" />'. |
'</td>'; |
&mt('Add').'</label>'. |
|
'</td>'; |
|
} |
} |
} |
$output .= '<td>'.$key.'</td><td>'; |
$output .= '<td>'.$key.'</td><td>'; |
foreach my $level ('course','domain','system') { |
foreach my $level ('course','domain','system') { |
Line 1202 sub print_user_modification_page {
|
Line 1218 sub print_user_modification_page {
|
} |
} |
$response .= '<p class="LC_warning">' |
$response .= '<p class="LC_warning">' |
.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.") |
.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.") |
.' ' |
.' '; |
.&mt('Please contact the [_1]helpdesk[_2] for assistance.' |
if ($context eq 'domain') { |
,'<a href="'.$helplink.'">','</a>') |
$response .= &mt('Please contact a [_1] for assistance.', |
.'</p><br />'; |
&Apache::lonnet::plaintext('dc')); |
|
} else { |
|
$response .= &mt('Please contact the [_1]helpdesk[_2] for assistance.' |
|
,'<a href="'.$helplink.'">','</a>'); |
|
} |
|
$response .= '</p><br />'; |
$env{'form.phase'} = ''; |
$env{'form.phase'} = ''; |
&print_username_entry_form($r,$context,$response,undef,undef,$crstype,$brcrum); |
&print_username_entry_form($r,$context,$response,undef,undef,$crstype,$brcrum); |
return; |
return; |
Line 1462 ENDAUTH
|
Line 1483 ENDAUTH
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
} else { |
} else { |
$title = &mt('Modify existing user: [_1] in domain [_2]', |
if ($permission->{'cusr'}) { |
|
$title = &mt('Modify existing user: [_1] in domain [_2]', |
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
|
} else { |
|
$title = &mt('Existing user: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
|
} |
} |
} |
$r->print('<h2>'.$title.'</h2>'."\n"); |
$r->print('<h2>'.$title.'</h2>'."\n"); |
$r->print('<div class="LC_left_float">'); |
$r->print('<div class="LC_left_float">'); |
$r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
$r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
$inst_results{$ccuname.':'.$ccdomain})); |
$inst_results{$ccuname.':'.$ccdomain})); |
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || |
|
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) { |
$r->print('<br /><h3>'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'</h3>'. |
$r->print('<br /><h3>'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'</h3>'. |
&Apache::loncommon::start_data_table()); |
&Apache::loncommon::start_data_table()); |
if ($env{'request.role.domain'} eq $ccdomain) { |
if ($env{'request.role.domain'} eq $ccdomain) { |
Line 1484 ENDAUTH
|
Line 1511 ENDAUTH
|
my @order = ('auth','quota','tools','requestauthor','adhocroles'); |
my @order = ('auth','quota','tools','requestauthor','adhocroles'); |
my %user_text; |
my %user_text; |
my ($isadv,$isauthor) = |
my ($isadv,$isauthor) = |
&Apache::lonnet::is_advanced_user($ccuname,$ccdomain); |
&Apache::lonnet::is_advanced_user($ccdomain,$ccuname); |
if ((!$isauthor) && |
if ((!$isauthor) && |
(&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) |
((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) || |
&& ($env{'request.role.domain'} eq $ccdomain)) { |
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) && |
|
($env{'request.role.domain'} eq $ccdomain)) { |
$user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain); |
$user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain); |
} |
} |
if (&Apache::lonnet::allowed('cdh',$env{'request.role.domain'})) { |
if ((&Apache::lonnet::allowed('cdh',$env{'request.role.domain'})) || |
|
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) { |
$user_text{'adhocroles'} = &domadhocroles($ccuname,$ccdomain); |
$user_text{'adhocroles'} = &domadhocroles($ccuname,$ccdomain); |
} |
} |
$user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname); |
$user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname); |
if ((&Apache::lonnet::allowed('mpq',$ccdomain)) || |
if ((&Apache::lonnet::allowed('mpq',$ccdomain)) || |
(&Apache::lonnet::allowed('mut',$ccdomain))) { |
(&Apache::lonnet::allowed('mut',$ccdomain)) || |
|
(&Apache::lonnet::allowed('udp',$ccdomain))) { |
# Current user has quota modification privileges |
# Current user has quota modification privileges |
$user_text{'quota'} = &user_quotas($ccuname,$ccdomain); |
$user_text{'quota'} = &user_quotas($ccuname,$ccdomain); |
} |
} |
Line 1553 ENDNOTOOLSPRIV
|
Line 1583 ENDNOTOOLSPRIV
|
if ($gotdiv) { |
if ($gotdiv) { |
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
} |
} |
|
my $statuses; |
|
if (($context eq 'domain') && (&Apache::lonnet::allowed('udp',$ccdomain)) && |
|
(!&Apache::lonnet::allowed('mau',$ccdomain))) { |
|
$statuses = ['active']; |
|
} elsif (($context eq 'course') && ((&Apache::lonnet::allowed('vcl',$env{'request.course.id'})) || |
|
($env{'request.course.sec'} && |
|
&Apache::lonnet::allowed('vcl',$env{'request.course.id'}.'/'.$env{'request.course.sec'})))) { |
|
$statuses = ['active']; |
|
} |
if ($env{'form.action'} ne 'singlestudent') { |
if ($env{'form.action'} ne 'singlestudent') { |
&display_existing_roles($r,$ccuname,$ccdomain,\%inccourses,$context, |
&display_existing_roles($r,$ccuname,$ccdomain,\%inccourses,$context, |
$roledom,$crstype); |
$roledom,$crstype,$showcredits,$statuses); |
} |
} |
} ## End of new user/old user logic |
} ## End of new user/old user logic |
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
Line 1566 ENDNOTOOLSPRIV
|
Line 1605 ENDNOTOOLSPRIV
|
$btntxt = &mt('Enroll Student'); |
$btntxt = &mt('Enroll Student'); |
} |
} |
$r->print('<br /><input type="button" value="'.$btntxt.'" onclick="setSections(this.form)" />'."\n"); |
$r->print('<br /><input type="button" value="'.$btntxt.'" onclick="setSections(this.form)" />'."\n"); |
} else { |
} elsif ($permission->{'cusr'}) { |
$r->print('<div class="LC_left_float">'. |
$r->print('<div class="LC_left_float">'. |
'<fieldset><legend>'.&mt('Add Roles').'</legend>'); |
'<fieldset><legend>'.&mt('Add Roles').'</legend>'); |
my $addrolesdisplay = 0; |
my $addrolesdisplay = 0; |
Line 1696 sub validation_javascript {
|
Line 1735 sub validation_javascript {
|
|
|
sub display_existing_roles { |
sub display_existing_roles { |
my ($r,$ccuname,$ccdomain,$inccourses,$context,$roledom,$crstype, |
my ($r,$ccuname,$ccdomain,$inccourses,$context,$roledom,$crstype, |
$showcredits) = @_; |
$showcredits,$statuses) = @_; |
my $now=time; |
my $now=time; |
|
my $showall = 1; |
|
my ($showexpired,$showactive); |
|
if ((ref($statuses) eq 'ARRAY') && (@{$statuses} > 0)) { |
|
$showall = 0; |
|
if (grep(/^expired$/,@{$statuses})) { |
|
$showexpired = 1; |
|
} |
|
if (grep(/^active$/,@{$statuses})) { |
|
$showactive = 1; |
|
} |
|
if ($showexpired && $showactive) { |
|
$showall = 1; |
|
} |
|
} |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'rer' => "Existing Roles", |
'rer' => "Existing Roles", |
'rev' => "Revoke", |
'rev' => "Revoke", |
Line 1761 sub display_existing_roles {
|
Line 1814 sub display_existing_roles {
|
$area =~ s/\_\w\w$//; |
$area =~ s/\_\w\w$//; |
my ($role_code,$role_end_time,$role_start_time) = |
my ($role_code,$role_end_time,$role_start_time) = |
split(/_/,$role); |
split(/_/,$role); |
|
my $active=1; |
|
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
|
if ($active) { |
|
next unless($showall || $showactive); |
|
} else { |
|
next unless($showall || $showexpired); |
|
} |
# Is this a custom role? Get role owner and title. |
# Is this a custom role? Get role owner and title. |
my ($croleudom,$croleuname,$croletitle)= |
my ($croleudom,$croleuname,$croletitle)= |
($role_code=~m{^cr/($match_domain)/($match_username)/(\w+)$}); |
($role_code=~m{^cr/($match_domain)/($match_username)/(\w+)$}); |
Line 1769 sub display_existing_roles {
|
Line 1829 sub display_existing_roles {
|
my $sortkey=$role_code; |
my $sortkey=$role_code; |
my $class='Unknown'; |
my $class='Unknown'; |
my $credits=''; |
my $credits=''; |
|
my $csec; |
if ($area =~ m{^/($match_domain)/($match_courseid)} ) { |
if ($area =~ m{^/($match_domain)/($match_courseid)} ) { |
$class='Course'; |
$class='Course'; |
my ($coursedom,$coursedir) = ($1,$2); |
my ($coursedom,$coursedir) = ($1,$2); |
Line 1831 sub display_existing_roles {
|
Line 1892 sub display_existing_roles {
|
$thisrole.='.'.$role_code; |
$thisrole.='.'.$role_code; |
} |
} |
} |
} |
if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) { |
if ($area=~m{^/($match_domain/$match_courseid/(\w+))}) { |
$carea.='<br />'.&mt('Section: [_1]',$3); |
$csec = $2; |
$sortkey.="\0$3"; |
$carea.='<br />'.&mt('Section: [_1]',$csec); |
|
$sortkey.="\0$csec"; |
if (!$allowed) { |
if (!$allowed) { |
if ($env{'request.course.sec'} eq $3) { |
if ($env{'request.course.sec'} eq $csec) { |
if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) { |
if (&Apache::lonnet::allowed('c'.$role_code,$1)) { |
$allowed = 1; |
$allowed = 1; |
} |
} |
} |
} |
Line 1878 sub display_existing_roles {
|
Line 1940 sub display_existing_roles {
|
} |
} |
} |
} |
my $row = ''; |
my $row = ''; |
$row.= '<td>'; |
if ($showall) { |
my $active=1; |
$row.= '<td>'; |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
if (($active) && ($allowed)) { |
if (($active) && ($allowed)) { |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
|
} else { |
|
if ($active) { |
|
$row.=' '; |
|
} else { |
} else { |
$row.=&mt('expired or revoked'); |
if ($active) { |
|
$row.=' '; |
|
} else { |
|
$row.=&mt('expired or revoked'); |
|
} |
} |
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($allowed && !$active) { |
if ($allowed && !$active) { |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($delallowed) { |
if ($delallowed) { |
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
|
$row.= '</td>'; |
} |
} |
my $plaintext=''; |
my $plaintext=''; |
if (!$croletitle) { |
if (!$croletitle) { |
Line 1918 sub display_existing_roles {
|
Line 1981 sub display_existing_roles {
|
'<br />', |
'<br />', |
$croleuname.':'.$croleudom); |
$croleuname.':'.$croleudom); |
} |
} |
$row.= '</td><td>'.$plaintext. |
$row.= '<td>'.$plaintext.'</td>'. |
'</td><td>'.$area. |
'<td>'.$area.'</td>'. |
'</td><td>'.($role_start_time?&Apache::lonlocal::locallocaltime($role_start_time) |
'<td>'.($role_start_time?&Apache::lonlocal::locallocaltime($role_start_time) |
: ' ' ). |
: ' ' ).'</td>'. |
'</td><td>'.($role_end_time ?&Apache::lonlocal::locallocaltime($role_end_time) |
'<td>'.($role_end_time ?&Apache::lonlocal::locallocaltime($role_end_time) |
: ' ' ) |
: ' ' ).'</td>'; |
."</td>"; |
|
$sortrole{$sortkey}=$envkey; |
$sortrole{$sortkey}=$envkey; |
$roletext{$envkey}=$row; |
$roletext{$envkey}=$row; |
$roleclass{$envkey}=$class; |
$roleclass{$envkey}=$class; |
$rolepriv{$envkey}=$allowed; |
if ($allowed) { |
|
$rolepriv{$envkey}='edit'; |
|
} else { |
|
if ($context eq 'domain') { |
|
if (&Apache::lonnet::allowed('vur',$ccdomain)) { |
|
$rolepriv{$envkey}='view'; |
|
} |
|
} elsif ($context eq 'course') { |
|
if ((&Apache::lonnet::allowed('vcl',$env{'request.course.id'})) || |
|
($env{'request.course.sec'} && ($env{'request.course.sec'} eq $csec) && |
|
&Apache::lonnet::allowed('vcl',$env{'request.course.id'}.'/'.$env{'request.course.sec'}))) { |
|
$rolepriv{$envkey}='view'; |
|
} |
|
} |
|
} |
} # end of foreach (table building loop) |
} # end of foreach (table building loop) |
|
|
my $rolesdisplay = 0; |
my $rolesdisplay = 0; |
Line 1961 sub display_existing_roles {
|
Line 2037 sub display_existing_roles {
|
} elsif ($env{'request.role'} =~ /^au\./) { |
} elsif ($env{'request.role'} =~ /^au\./) { |
$contextrole = &mt('Existing Co-Author Roles in your Authoring Space'); |
$contextrole = &mt('Existing Co-Author Roles in your Authoring Space'); |
} else { |
} else { |
$contextrole = &mt('Existing Roles in this Domain'); |
if ($showall) { |
|
$contextrole = &mt('Existing Roles in this Domain'); |
|
} elsif ($showactive) { |
|
$contextrole = &mt('Unexpired Roles in this Domain'); |
|
} elsif ($showexpired) { |
|
$contextrole = &mt('Expired or Revoked Roles in this Domain'); |
|
} |
} |
} |
$r->print('<div class="LC_left_float">'. |
$r->print('<div class="LC_left_float">'. |
'<fieldset><legend>'.$contextrole.'</legend>'. |
'<fieldset><legend>'.$contextrole.'</legend>'. |
&Apache::loncommon::start_data_table("LC_createuser"). |
&Apache::loncommon::start_data_table("LC_createuser"). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row()); |
'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}. |
if ($showall) { |
'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}. |
$r->print( |
'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}.'</th>' |
|
); |
|
} elsif ($showexpired) { |
|
$r->print('<th>'.$lt{'rev'}.'</th>'); |
|
} |
|
$r->print( |
|
'<th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th>'. |
|
'<th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row()); |
&Apache::loncommon::end_data_table_header_row()); |
foreach my $type ('Authoring Space','Course','Community','Domain','System','Unknown') { |
foreach my $type ('Authoring Space','Course','Community','Domain','System','Unknown') { |
if ($output{$type}) { |
if ($output{$type}) { |
Line 2107 sub user_authentication {
|
Line 2196 sub user_authentication {
|
my ($ccuname,$ccdomain,$formname) = @_; |
my ($ccuname,$ccdomain,$formname) = @_; |
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); |
my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); |
my $outcome; |
my $outcome; |
|
my %lt=&Apache::lonlocal::texthash( |
|
'err' => "ERROR", |
|
'uuas' => "This user has an unrecognized authentication scheme", |
|
'adcs' => "Please alert a domain coordinator of this situation", |
|
'sldb' => "Please specify login data below", |
|
'ld' => "Login Data" |
|
); |
# Check for a bad authentication type |
# Check for a bad authentication type |
if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth):/) { |
if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth):/) { |
# bad authentication scheme |
# bad authentication scheme |
my %lt=&Apache::lonlocal::texthash( |
|
'err' => "ERROR", |
|
'uuas' => "This user has an unrecognized authentication scheme", |
|
'adcs' => "Please alert a domain coordinator of this situation", |
|
'sldb' => "Please specify login data below", |
|
'ld' => "Login Data" |
|
); |
|
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
&initialize_authen_forms($ccdomain,$formname); |
&initialize_authen_forms($ccdomain,$formname); |
|
|
Line 2147 ENDBADAUTH
|
Line 2236 ENDBADAUTH
|
&modify_login_block($ccdomain,$currentauth); |
&modify_login_block($ccdomain,$currentauth); |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
# Current user has login modification privileges |
# Current user has login modification privileges |
my %lt=&Apache::lonlocal::texthash ( |
|
'ld' => "Login Data", |
|
'ccld' => "Change Current Login Data", |
|
'enld' => "Enter New Login Data" |
|
); |
|
$outcome = |
$outcome = |
'<script type="text/javascript" language="Javascript">'."\n". |
'<script type="text/javascript" language="Javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
Line 2162 ENDBADAUTH
|
Line 2246 ENDBADAUTH
|
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td>'.$authformnop; |
'<td>'.$authformnop; |
if ($can_modify) { |
if (($can_modify) && (&Apache::lonnet::allowed('mau',$ccdomain))) { |
$outcome .= '</td>'."\n". |
$outcome .= '</td>'."\n". |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
Line 2172 ENDBADAUTH
|
Line 2256 ENDBADAUTH
|
$outcome .= ' ('.$authformcurrent.')</td>'. |
$outcome .= ' ('.$authformcurrent.')</td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
foreach my $item (@authform_others) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
$outcome .= &Apache::loncommon::start_data_table_row(). |
foreach my $item (@authform_others) { |
'<td>'.$item.'</td>'. |
$outcome .= &Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::end_data_table_row()."\n"; |
'<td>'.$item.'</td>'. |
|
&Apache::loncommon::end_data_table_row()."\n"; |
|
} |
} |
} |
$outcome .= &Apache::loncommon::end_data_table(); |
$outcome .= &Apache::loncommon::end_data_table(); |
} else { |
} else { |
if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('udp',$ccdomain)) { |
|
# Current user has rights to view domain preferences for user's domain |
|
my $result; |
|
if ($currentauth =~ /^krb(4|5):([^:]*)$/) { |
|
my ($krbver,$krbrealm) = ($1,$2); |
|
if ($krbrealm eq '') { |
|
$result = &mt('Currently Kerberos authenticated, Version [_1].',$krbver); |
|
} else { |
|
$result = &mt('Currently Kerberos authenticated with domain [_1] Version [_2].', |
|
$krbver,$krbrealm); |
|
} |
|
} elsif ($currentauth =~ /^internal:/) { |
|
$result = &mt('Currently internally authenticated.'); |
|
} elsif ($currentauth =~ /^localauth:/) { |
|
$result = &mt('Currently using local (institutional) authentication.'); |
|
} elsif ($currentauth =~ /^unix:/) { |
|
$result = &mt('Currently Filesystem Authenticated.'); |
|
} |
|
$outcome = '<h3>'.$lt{'ld'}.'</h3>'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_row(). |
|
'<td>'.$result.'</td>'. |
|
&Apache::loncommon::end_data_table_row()."\n". |
|
&Apache::loncommon::end_data_table(); |
|
} elsif (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'ccld' => "Change Current Login Data", |
'ccld' => "Change Current Login Data", |
'yodo' => "You do not have privileges to modify the authentication configuration for this user.", |
'yodo' => "You do not have privileges to modify the authentication configuration for this user.", |
Line 4620 sub handler {
|
Line 4730 sub handler {
|
} |
} |
} elsif (((($env{'form.action'} eq 'singleuser') || ($env{'form.action'} |
} elsif (((($env{'form.action'} eq 'singleuser') || ($env{'form.action'} |
eq 'singlestudent')) && ($permission->{'cusr'})) || |
eq 'singlestudent')) && ($permission->{'cusr'})) || |
|
(($env{'form.action'} eq 'singleuser') && ($permission->{'view'})) || |
(($env{'form.action'} eq 'accesslogs') && ($permission->{'activity'}))) { |
(($env{'form.action'} eq 'accesslogs') && ($permission->{'activity'}))) { |
my $phase = $env{'form.phase'}; |
my $phase = $env{'form.phase'}; |
my @search = ('srchterm','srchby','srchin','srchtype','srchdomain'); |
my @search = ('srchterm','srchby','srchin','srchtype','srchdomain'); |
Line 5027 sub handler {
|
Line 5138 sub handler {
|
'<span class="LC_error">'.&mt('You do not have permission to configure self-enrollment').'</span>'); |
'<span class="LC_error">'.&mt('You do not have permission to configure self-enrollment').'</span>'); |
} |
} |
} elsif ($env{'form.action'} eq 'selfenrollqueue') { |
} elsif ($env{'form.action'} eq 'selfenrollqueue') { |
push(@{$brcrum}, |
if ($permission->{selfenrolladmin}) { |
{href => '/adm/createuser?action=selfenrollqueue', |
|
text => 'Enrollment requests', |
|
help => 'Course_Self_Enrollment'}); |
|
$bread_crumbs_component = 'Enrollment requests'; |
|
if ($env{'form.state'} eq 'done') { |
|
push(@{$brcrum}, |
push(@{$brcrum}, |
{href => '/adm/createuser?action=selfenrollqueue', |
{href => '/adm/createuser?action=selfenrollqueue', |
text => 'Result', |
text => 'Enrollment requests', |
help => 'Course_Self_Enrollment'}); |
help => 'Course_Self_Enrollment'}); |
$bread_crumbs_component = 'Enrollment result'; |
$bread_crumbs_component = 'Enrollment requests'; |
} |
if ($env{'form.state'} eq 'done') { |
$args = { bread_crumbs => $brcrum, |
push(@{$brcrum}, |
bread_crumbs_component => $bread_crumbs_component}; |
{href => '/adm/createuser?action=selfenrollqueue', |
$r->print(&header(undef,$args)); |
text => 'Result', |
my $cid = $env{'request.course.id'}; |
help => 'Course_Self_Enrollment'}); |
my $cdom = $env{'course.'.$cid.'.domain'}; |
$bread_crumbs_component = 'Enrollment result'; |
my $cnum = $env{'course.'.$cid.'.num'}; |
} |
my $coursedesc = $env{'course.'.$cid.'.description'}; |
$args = { bread_crumbs => $brcrum, |
if (!exists($env{'form.state'})) { |
bread_crumbs_component => $bread_crumbs_component}; |
$r->print('<h3>'.&mt('Pending enrollment requests').'</h3>'."\n"); |
$r->print(&header(undef,$args)); |
$r->print(&Apache::loncoursequeueadmin::display_queued_requests($context, |
my $cid = $env{'request.course.id'}; |
$cdom,$cnum)); |
my $cdom = $env{'course.'.$cid.'.domain'}; |
} elsif ($env{'form.state'} eq 'done') { |
my $cnum = $env{'course.'.$cid.'.num'}; |
$r->print('<h3>'.&mt('Enrollment request processing').'</h3>'."\n"); |
my $coursedesc = $env{'course.'.$cid.'.description'}; |
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context, |
if (!exists($env{'form.state'})) { |
$cdom,$cnum,$coursedesc)); |
$r->print('<h3>'.&mt('Pending enrollment requests').'</h3>'."\n"); |
|
$r->print(&Apache::loncoursequeueadmin::display_queued_requests($context, |
|
$cdom,$cnum)); |
|
} elsif ($env{'form.state'} eq 'done') { |
|
$r->print('<h3>'.&mt('Enrollment request processing').'</h3>'."\n"); |
|
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context, |
|
$cdom,$cnum,$coursedesc)); |
|
} |
|
} else { |
|
$r->print(&header(undef,{'no_nav_bar' => 1}). |
|
'<span class="LC_error">'.&mt('You do not have permission to manage self-enrollment').'</span>'); |
} |
} |
|
|
} elsif ($env{'form.action'} eq 'changelogs') { |
} elsif ($env{'form.action'} eq 'changelogs') { |
&print_userchangelogs_display($r,$context,$permission,$brcrum); |
if ($permission->{cusr} || $permission->{view}) { |
|
&print_userchangelogs_display($r,$context,$permission,$brcrum); |
|
} else { |
|
$r->print(&header(undef,{'no_nav_bar' => 1}). |
|
'<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>'); |
|
} |
} else { |
} else { |
$bread_crumbs_component = 'User Management'; |
$bread_crumbs_component = 'User Management'; |
$args = { bread_crumbs => $brcrum, |
$args = { bread_crumbs => $brcrum, |
Line 5308 sub print_main_menu {
|
Line 5430 sub print_main_menu {
|
listusers => 'Show and manage users in this community.', |
listusers => 'Show and manage users in this community.', |
}, |
}, |
); |
); |
|
if ($linkcontext eq 'domain') { |
|
unless ($permission->{'cusr'}) { |
|
$links{'domain'}{'singleuser'} = 'View a User'; |
|
$linktitles{'domain'}{'singleuser'} = 'View information about a user in the domain'; |
|
|
|
} |
|
} elsif ($linkcontext eq 'course') { |
|
unless ($permission->{'cusr'}) { |
|
$links{'course'}{'singleuser'} = 'View a Course User'; |
|
$linktitles{'course'}{'singleuser'} = 'View information about a user in this course'; |
|
$links{'course'}{'listusers'} = 'List Course Users'; |
|
$linktitles{'course'}{'listusers'} = 'Show information about users in this course'; |
|
} |
|
} elsif ($linkcontext eq 'community') { |
|
unless ($permission->{'cusr'}) { |
|
$links{'community'}{'singleuser'} = 'View a Community User'; |
|
$linktitles{'community'}{'singleuser'} = 'View information about a user in this community'; |
|
$links{'community'}{'listusers'} = 'List Community Users'; |
|
$linktitles{'community'}{'listusers'} = 'Show information about users in this community'; |
|
} |
|
} |
my @menu = ( {categorytitle => 'Single Users', |
my @menu = ( {categorytitle => 'Single Users', |
items => |
items => |
[ |
[ |
Line 5316 sub print_main_menu {
|
Line 5459 sub print_main_menu {
|
icon => 'edit-redo.png', |
icon => 'edit-redo.png', |
#help => 'Course_Change_Privileges', |
#help => 'Course_Change_Privileges', |
url => '/adm/createuser?action=singleuser', |
url => '/adm/createuser?action=singleuser', |
permission => $permission->{'cusr'}, |
permission => ($permission->{'view'} || $permission->{'cusr'}), |
linktitle => $linktitles{$linkcontext}{'singleuser'}, |
linktitle => $linktitles{$linkcontext}{'singleuser'}, |
}, |
}, |
]}, |
]}, |
Line 5389 sub print_main_menu {
|
Line 5532 sub print_main_menu {
|
icon => 'document-properties.png', |
icon => 'document-properties.png', |
#help => 'Course_User_Logs', |
#help => 'Course_User_Logs', |
url => '/adm/createuser?action=changelogs', |
url => '/adm/createuser?action=changelogs', |
permission => $permission->{'cusr'}, |
permission => ($permission->{'cusr'} || $permission->{'view'}), |
linktitle => 'View change log.', |
linktitle => 'View change log.', |
}, |
}, |
); |
); |
Line 5466 sub print_main_menu {
|
Line 5609 sub print_main_menu {
|
icon => 'document-properties.png', |
icon => 'document-properties.png', |
#help => 'Course_User_Logs', |
#help => 'Course_User_Logs', |
url => '/adm/createuser?action=changelogs', |
url => '/adm/createuser?action=changelogs', |
permission => $permission->{'cusr'}, |
permission => ($permission->{'view'} || $permission->{'cusr'}), |
linktitle => 'View change log.', |
linktitle => 'View change log.', |
}, |
}, |
); |
); |
Line 5491 sub print_main_menu {
|
Line 5634 sub print_main_menu {
|
icon => 'roles.png', |
icon => 'roles.png', |
#help => 'Course_Automated_Enrollment', |
#help => 'Course_Automated_Enrollment', |
permission => (&Apache::lonnet::auto_run($cnum,$cdom) |
permission => (&Apache::lonnet::auto_run($cnum,$cdom) |
&& $permission->{'cusr'}), |
&& (($permission->{'cusr'}) || |
|
($permission->{'view'}))), |
url => '/adm/populate', |
url => '/adm/populate', |
linktitle => 'Automated enrollment manager.', |
linktitle => 'Automated enrollment manager.', |
} |
} |
Line 5540 sub restore_prev_selections {
|
Line 5684 sub restore_prev_selections {
|
} |
} |
|
|
sub print_selfenroll_menu { |
sub print_selfenroll_menu { |
my ($r,$context,$cid,$cdom,$cnum,$currsettings,$additional) = @_; |
my ($r,$context,$cid,$cdom,$cnum,$currsettings,$additional,$readonly) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $formname = 'selfenroll'; |
my $formname = 'selfenroll'; |
my $nolink = 1; |
my $nolink = 1; |
Line 5553 sub print_selfenroll_menu {
|
Line 5697 sub print_selfenroll_menu {
|
butn => 'but no user types have been checked.', |
butn => 'but no user types have been checked.', |
wilf => "Please uncheck 'activate' or check at least one type.", |
wilf => "Please uncheck 'activate' or check at least one type.", |
); |
); |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
&js_escape(\%alerts); |
&js_escape(\%alerts); |
my $selfenroll_js = <<"ENDSCRIPT"; |
my $selfenroll_js = <<"ENDSCRIPT"; |
function update_types(caller,num) { |
function update_types(caller,num) { |
Line 5868 ENDSCRIPT
|
Line 6016 ENDSCRIPT
|
$output .= ' checked="checked" '; |
$output .= ' checked="checked" '; |
} |
} |
$output .= 'onchange="javascript:update_types('. |
$output .= 'onchange="javascript:update_types('. |
"'selfenroll_all'".');" />'.&mt('Yes').'</label>'. |
"'selfenroll_all'".');"'.$disabled.' />'.&mt('Yes').'</label>'. |
' <input type="radio" name="selfenroll_all" value="0" '; |
' <input type="radio" name="selfenroll_all" value="0" '; |
if ($curr_types ne '*') { |
if ($curr_types ne '*') { |
$output .= ' checked="checked" '; |
$output .= ' checked="checked" '; |
} |
} |
$output .= ' onchange="javascript:update_types('. |
$output .= ' onchange="javascript:update_types('. |
"'selfenroll_all'".');"/>'.&mt('No').'</label></td>'. |
"'selfenroll_all'".');"'.$disabled.' />'.&mt('No').'</label></td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
&mt('Or').'<br />'. |
&mt('Or').'<br />'. |
Line 5896 ENDSCRIPT
|
Line 6044 ENDSCRIPT
|
.'</b><input type="hidden" name="selfenroll_dom_'.$num |
.'</b><input type="hidden" name="selfenroll_dom_'.$num |
.'" value="'.$currdom.'" /></span><br />' |
.'" value="'.$currdom.'" /></span><br />' |
.'<span class="LC_nobreak"><label><input type="checkbox" ' |
.'<span class="LC_nobreak"><label><input type="checkbox" ' |
.'name="selfenroll_delete" value="'.$num.'" onchange="javascript:update_types('."'selfenroll_delete','$num'".');" />' |
.'name="selfenroll_delete" value="'.$num.'" onchange="javascript:update_types('."'selfenroll_delete','$num'".');"'.$disabled.' />' |
.&mt('Delete').'</label></span></td>'; |
.&mt('Delete').'</label></span></td>'; |
$output .= '<td valign="top"> '.&mt('User types:').'<br />' |
$output .= '<td valign="top"> '.&mt('User types:').'<br />' |
.&selfenroll_inst_types($num,$currdom,\@currinsttypes).'</td>' |
.&selfenroll_inst_types($num,$currdom,\@currinsttypes,$readonly).'</td>' |
.&Apache::loncommon::end_data_table_row(); |
.&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
} |
} |
Line 5914 ENDSCRIPT
|
Line 6062 ENDSCRIPT
|
$output .= &Apache::loncommon::start_data_table_row() |
$output .= &Apache::loncommon::start_data_table_row() |
.'<td colspan="2"><span class="LC_nobreak">'.$add_domtitle.'</span><br />' |
.'<td colspan="2"><span class="LC_nobreak">'.$add_domtitle.'</span><br />' |
.&Apache::loncommon::select_dom_form('','selfenroll_newdom', |
.&Apache::loncommon::select_dom_form('','selfenroll_newdom', |
$includeempty,$showdomdesc) |
$includeempty,$showdomdesc,'','','',$readonly) |
.'<input type="hidden" name="selfenroll_types_total" value="'.$num.'" />' |
.'<input type="hidden" name="selfenroll_types_total" value="'.$num.'" />' |
.'</td>'.&Apache::loncommon::end_data_table_row() |
.'</td>'.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table(); |
.&Apache::loncommon::end_data_table(); |
Line 5935 ENDSCRIPT
|
Line 6083 ENDSCRIPT
|
} |
} |
if ($registered) { |
if ($registered) { |
$regon = ' checked="checked" '; |
$regon = ' checked="checked" '; |
$regoff = ' '; |
$regoff = ''; |
} else { |
} else { |
$regon = ' '; |
$regon = ''; |
$regoff = ' checked="checked" '; |
$regoff = ' checked="checked" '; |
} |
} |
$output .= '<label>'. |
$output .= '<label>'. |
'<input type="radio" name="selfenroll_registered" value="1"'.$regon.'/>'. |
'<input type="radio" name="selfenroll_registered" value="1"'.$regon.$disabled.' />'. |
&mt('Yes').'</label> <label>'. |
&mt('Yes').'</label> <label>'. |
'<input type="radio" name="selfenroll_registered" value="0"'.$regoff.'/>'. |
'<input type="radio" name="selfenroll_registered" value="0"'.$regoff.$disabled.' />'. |
&mt('No').'</label>'; |
&mt('No').'</label>'; |
} elsif ($item eq 'enroll_dates') { |
} elsif ($item eq 'enroll_dates') { |
my ($starttime,$endtime); |
my ($starttime,$endtime); |
Line 5965 ENDSCRIPT
|
Line 6113 ENDSCRIPT
|
} |
} |
my $startform = |
my $startform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_date',$starttime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_date',$starttime, |
undef,undef,undef,undef,undef,undef,undef,$nolink); |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
my $endform = |
my $endform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_end_date',$endtime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_end_date',$endtime, |
undef,undef,undef,undef,undef,undef,undef,$nolink); |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
$output .= &selfenroll_date_forms($startform,$endform); |
$output .= &selfenroll_date_forms($startform,$endform); |
} elsif ($item eq 'access_dates') { |
} elsif ($item eq 'access_dates') { |
my ($starttime,$endtime); |
my ($starttime,$endtime); |
Line 5990 ENDSCRIPT
|
Line 6138 ENDSCRIPT
|
} |
} |
my $startform = |
my $startform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_access',$starttime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_access',$starttime, |
undef,undef,undef,undef,undef,undef,undef,$nolink); |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
my $endform = |
my $endform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_end_access',$endtime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_end_access',$endtime, |
undef,undef,undef,undef,undef,undef,undef,$nolink); |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
$output .= &selfenroll_date_forms($startform,$endform); |
$output .= &selfenroll_date_forms($startform,$endform); |
} elsif ($item eq 'section') { |
} elsif ($item eq 'section') { |
my $currsec; |
my $currsec; |
Line 6017 ENDSCRIPT
|
Line 6165 ENDSCRIPT
|
next; |
next; |
} |
} |
my $sections_select = |
my $sections_select = |
&Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec); |
&Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec,$disabled); |
$output .= '<table class="LC_createuser">'."\n". |
$output .= '<table class="LC_createuser">'."\n". |
'<tr class="LC_section_row">'."\n". |
'<tr class="LC_section_row">'."\n". |
'<td align="center">'.&mt('Existing sections')."\n". |
'<td align="center">'.&mt('Existing sections')."\n". |
'<br />'.$sections_select.'</td><td align="center">'. |
'<br />'.$sections_select.'</td><td align="center">'. |
&mt('New section').'<br />'."\n". |
&mt('New section').'<br />'."\n". |
'<input type="text" name="newsec" size="15" value="'.$newsecval.'" />'."\n". |
'<input type="text" name="newsec" size="15" value="'.$newsecval.'"'.$disabled.' />'."\n". |
'<input type="hidden" name="sections" value="" />'."\n". |
'<input type="hidden" name="sections" value="" />'."\n". |
'</td></tr></table>'."\n"; |
'</td></tr></table>'."\n"; |
} elsif ($item eq 'approval') { |
} elsif ($item eq 'approval') { |
my ($currnotified,$currapproval,%appchecked); |
my ($currnotified,$currapproval,%appchecked); |
my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs(); |
my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs(); |
if (ref($currsettings) eq 'HASH') { |
if (ref($currsettings) eq 'HASH') { |
$currnotified = $currsettings->{'selfenroll_notifylist'}; |
$currnotified = $currsettings->{'selfenroll_notifylist'}; |
$currapproval = $currsettings->{'selfenroll_approval'}; |
$currapproval = $currsettings->{'selfenroll_approval'}; |
} |
} |
Line 6045 ENDSCRIPT
|
Line 6193 ENDSCRIPT
|
for my $i (0..2) { |
for my $i (0..2) { |
$output .= '<label>'. |
$output .= '<label>'. |
'<input type="radio" name="selfenroll_approval" value="'.$i.'"'. |
'<input type="radio" name="selfenroll_approval" value="'.$i.'"'. |
$appchecked{$i}.' onclick="toggleNotify();" />'.$selfdescs{'approval'}{$i}. |
$appchecked{$i}.' onclick="toggleNotify();"'.$disabled.' />'. |
'</label>'.(' 'x2); |
$selfdescs{'approval'}{$i}.'</label>'.(' 'x2); |
} |
} |
my %advhash = &Apache::lonnet::get_course_adv_roles($cid,1); |
my %advhash = &Apache::lonnet::get_course_adv_roles($cid,1); |
my (@ccs,%notified); |
my (@ccs,%notified); |
Line 6087 ENDSCRIPT
|
Line 6235 ENDSCRIPT
|
&Apache::loncommon::start_data_table_row() |
&Apache::loncommon::start_data_table_row() |
} |
} |
$output .= '<td><span class="LC_nobreak"><label>'. |
$output .= '<td><span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="selfenroll_notify"'.$notifyon.' value="'.$cc.'" />'. |
'<input type="checkbox" name="selfenroll_notify"'.$notifyon.' value="'.$cc.'"'.$disabled.' />'. |
&Apache::loncommon::plainname($ccuname,$ccudom). |
&Apache::loncommon::plainname($ccuname,$ccudom). |
'</label></span></td>'; |
'</label></span></td>'; |
$count ++; |
$count ++; |
Line 6137 ENDSCRIPT
|
Line 6285 ENDSCRIPT
|
$nolimit = ' checked="checked" '; |
$nolimit = ' checked="checked" '; |
} |
} |
$output .= '<table><tr><td><label>'. |
$output .= '<table><tr><td><label>'. |
'<input type="radio" name="selfenroll_limit" value="none"'.$nolimit.'/>'. |
'<input type="radio" name="selfenroll_limit" value="none"'.$nolimit.$disabled.'/>'. |
&mt('No limit').'</label></td><td><label>'. |
&mt('No limit').'</label></td><td><label>'. |
'<input type="radio" name="selfenroll_limit" value="allstudents"'.$crslimit.'/>'. |
'<input type="radio" name="selfenroll_limit" value="allstudents"'.$crslimit.$disabled.'/>'. |
&mt('Limit by total students').'</label></td><td><label>'. |
&mt('Limit by total students').'</label></td><td><label>'. |
'<input type="radio" name="selfenroll_limit" value="selfenrolled"'.$selflimit.'/>'. |
'<input type="radio" name="selfenroll_limit" value="selfenrolled"'.$selflimit.$disabled.'/>'. |
&mt('Limit by total self-enrolled students'). |
&mt('Limit by total self-enrolled students'). |
'</td></tr><tr>'. |
'</td></tr><tr>'. |
'<td> </td><td colspan="2"><span class="LC_nobreak">'. |
'<td> </td><td colspan="2"><span class="LC_nobreak">'. |
(' 'x3).&mt('Maximum number allowed: '). |
(' 'x3).&mt('Maximum number allowed: '). |
'<input type="text" name="selfenroll_cap" size = "5" value="'.$currcap.'" /></td></tr></table>'; |
'<input type="text" name="selfenroll_cap" size = "5" value="'.$currcap.'"'.$disabled.' /></td></tr></table>'; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
} |
} |
} |
} |
$output .= &Apache::lonhtmlcommon::end_pick_box(). |
$output .= &Apache::lonhtmlcommon::end_pick_box().'<br />'; |
'<br /><input type="button" name="selfenrollconf" value="' |
unless ($readonly) { |
.&mt('Save').'" onclick="validate_types(this.form);" />' |
$output .= '<input type="button" name="selfenrollconf" value="' |
.'<input type="hidden" name="action" value="selfenroll" />' |
.&mt('Save').'" onclick="validate_types(this.form);" />'; |
.'<input type="hidden" name="state" value="done" />'."\n". |
} |
$additional.'</form>'; |
$output .= '<input type="hidden" name="action" value="selfenroll" />' |
|
.'<input type="hidden" name="state" value="done" />'."\n" |
|
.$additional.'</form>'; |
$r->print($output); |
$r->print($output); |
return; |
return; |
} |
} |
Line 6339 sub new_selfenroll_dom_row {
|
Line 6489 sub new_selfenroll_dom_row {
|
} |
} |
|
|
sub selfenroll_inst_types { |
sub selfenroll_inst_types { |
my ($num,$currdom,$currinsttypes) = @_; |
my ($num,$currdom,$currinsttypes,$readonly) = @_; |
my $output; |
my $output; |
my $numinrow = 4; |
my $numinrow = 4; |
my $count = 0; |
my $count = 0; |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($currdom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($currdom); |
my $othervalue = 'any'; |
my $othervalue = 'any'; |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
if (keys(%{$usertypes}) > 0) { |
if (keys(%{$usertypes}) > 0) { |
$othervalue = 'other'; |
$othervalue = 'other'; |
Line 6369 sub selfenroll_inst_types {
|
Line 6523 sub selfenroll_inst_types {
|
$output .= 'checked="checked"'; |
$output .= 'checked="checked"'; |
} |
} |
} |
} |
$output .= ' name="selfenroll_types_'.$num.'" />'.$usertypes->{$type}.'</label></span></td>'; |
$output .= ' name="selfenroll_types_'.$num.'"'.$disabled.' />'.$usertypes->{$type}.'</label></span></td>'; |
} |
} |
$count ++; |
$count ++; |
} |
} |
Line 6392 sub selfenroll_inst_types {
|
Line 6546 sub selfenroll_inst_types {
|
} else { |
} else { |
$output .= ' checked="checked"'; |
$output .= ' checked="checked"'; |
} |
} |
$output .= ' name="selfenroll_types_'.$num.'" />'.$othertitle.'</label></span></td></tr></table>'; |
$output .= ' name="selfenroll_types_'.$num.'"'.$disabled.' />'.$othertitle.'</label></span></td></tr></table>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 6415 sub selfenroll_date_forms {
|
Line 6569 sub selfenroll_date_forms {
|
sub print_userchangelogs_display { |
sub print_userchangelogs_display { |
my ($r,$context,$permission,$brcrum) = @_; |
my ($r,$context,$permission,$brcrum) = @_; |
my $formname = 'rolelog'; |
my $formname = 'rolelog'; |
my ($username,$domain,$crstype,%roleslog); |
my ($username,$domain,$crstype,$viewablesec,%roleslog); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$domain = $env{'request.role.domain'}; |
$domain = $env{'request.role.domain'}; |
%roleslog=&Apache::lonnet::dump_dom('nohist_rolelog',$domain); |
%roleslog=&Apache::lonnet::dump_dom('nohist_rolelog',$domain); |
Line 6424 sub print_userchangelogs_display {
|
Line 6578 sub print_userchangelogs_display {
|
$domain = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$domain = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$username = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$username = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$crstype = &Apache::loncommon::course_type(); |
$crstype = &Apache::loncommon::course_type(); |
|
$viewablesec = &Apache::lonuserutils::viewable_section($permission); |
my %saveable_parameters = ('show' => 'scalar',); |
my %saveable_parameters = ('show' => 'scalar',); |
&Apache::loncommon::store_course_settings('roles_log', |
&Apache::loncommon::store_course_settings('roles_log', |
\%saveable_parameters); |
\%saveable_parameters); |
Line 6555 ENDSCRIPT
|
Line 6710 ENDSCRIPT
|
next if ($roleslog{$id}{'logentry'}{'context'} ne $curr{'chgcontext'}); |
next if ($roleslog{$id}{'logentry'}{'context'} ne $curr{'chgcontext'}); |
} |
} |
} |
} |
|
if (($context eq 'course') && ($viewablesec ne '')) { |
|
next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec); |
|
} |
$count ++; |
$count ++; |
next if ($count < $minshown); |
next if ($count < $minshown); |
unless ($showntableheader) { |
unless ($showntableheader) { |
Line 6794 ENDSCRIPT
|
Line 6952 ENDSCRIPT
|
$r->rflush(); |
$r->rflush(); |
$showntableheader = 1; |
$showntableheader = 1; |
} |
} |
my ($shown,$extra,); |
my ($shown,$extra); |
my ($event,$data) = split(/\s+/,&unescape($event)); |
my ($event,$data) = split(/\s+/,&unescape($event)); |
if ($event eq 'Role') { |
if ($event eq 'Role') { |
my ($rolecode,$extent) = split(/\./,$data,2); |
my ($rolecode,$extent) = split(/\./,$data,2); |
next if ($extent eq ''); |
next if ($extent eq ''); |
my ($crstype,$desc,$info); |
my ($crstype,$desc,$info); |
if ($extent =~ m{^/($match_domain)/($match_courseid)$}) { |
if ($extent =~ m{^/($match_domain)/($match_courseid)(?:/(\w+)|)$}) { |
my ($cdom,$cnum) = ($1,$2); |
my ($cdom,$cnum,$sec) = ($1,$2,$3); |
my $cid = $cdom.'_'.$cnum; |
my $cid = $cdom.'_'.$cnum; |
if (exists($courses{$cid})) { |
if (exists($courses{$cid})) { |
$crstype = $courses{$cid}{'type'}; |
$crstype = $courses{$cid}{'type'}; |
Line 6820 ENDSCRIPT
|
Line 6978 ENDSCRIPT
|
} |
} |
} |
} |
$extra = &mt($crstype).': <a href="/public/'.$cdom.'/'.$cnum.'/syllabus">'.$desc.'</a>'; |
$extra = &mt($crstype).': <a href="/public/'.$cdom.'/'.$cnum.'/syllabus">'.$desc.'</a>'; |
|
if ($sec ne '') { |
|
$extra .= ' ('.&mt('Section: [_1]',$sec).')'; |
|
} |
} elsif ($extent =~ m{^/($match_domain)/($match_username|$)}) { |
} elsif ($extent =~ m{^/($match_domain)/($match_username|$)}) { |
my ($dom,$name) = ($1,$2); |
my ($dom,$name) = ($1,$2); |
if ($rolecode eq 'au') { |
if ($rolecode eq 'au') { |