version 1.406.2.8, 2016/11/29 13:22:10
|
version 1.417, 2016/10/22 17:56:12
|
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 252 sub build_tools_display {
|
Line 251 sub build_tools_display {
|
'unofficial' => 'Can request creation of unofficial courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'community' => 'Can request creation of communities', |
'community' => 'Can request creation of communities', |
'textbook' => 'Can request creation of textbook courses', |
'textbook' => 'Can request creation of textbook courses', |
|
'placement' => 'Can request creation of placement tests', |
'requestauthor' => 'Can request author space', |
'requestauthor' => 'Can request author space', |
); |
); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.community','requestcourses.textbook'); |
'requestcourses.community','requestcourses.textbook', |
@usertools = ('official','unofficial','community','textbook'); |
'requestcourses.placement'); |
|
@usertools = ('official','unofficial','community','textbook','placement'); |
@options =('norequest','approval','autolimit','validate'); |
@options =('norequest','approval','autolimit','validate'); |
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain); |
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain); |
%reqtitles = &courserequest_titles(); |
%reqtitles = &courserequest_titles(); |
Line 266 sub build_tools_display {
|
Line 267 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($ccdomain,$ccuname); |
$isadv = &Apache::lonnet::is_advanced_user($ccuname,$ccdomain); |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'requestauthor'); |
'requestauthor'); |
Line 427 sub build_tools_display {
|
Line 428 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 438 sub build_tools_display {
|
Line 437 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 451 sub coursereq_externaluser {
|
Line 449 sub coursereq_externaluser {
|
'unofficial' => 'Can request creation of unofficial courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'community' => 'Can request creation of communities', |
'community' => 'Can request creation of communities', |
'textbook' => 'Can request creation of textbook courses', |
'textbook' => 'Can request creation of textbook courses', |
|
'placement' => 'Can request creation of placement tests', |
); |
); |
|
|
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community','reqcrsotherdom.textbook'); |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
@usertools = ('official','unofficial','community','textbook'); |
'reqcrsotherdom.placement'); |
|
@usertools = ('official','unofficial','community','textbook','placement'); |
@options = ('approval','validate','autolimit'); |
@options = ('approval','validate','autolimit'); |
%validations = &Apache::lonnet::auto_courserequest_checks($cdom); |
%validations = &Apache::lonnet::auto_courserequest_checks($cdom); |
my $optregex = join('|',@options); |
my $optregex = join('|',@options); |
Line 536 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,$canmodify); |
my $output; |
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 547 sub domadhocroles {
|
Line 544 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 563 sub domadhocroles {
|
Line 557 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(). |
if ($canmodify) { |
'<th>'.&mt('Action').'</th><th>'.&mt('Role').'</th>'. |
$output .= '<th>'.&mt('Action').'</th>'; |
'<th>'.&mt('Privileges in Course').'<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 ($canmodify) { |
if (grep(/^\Q$key\E$/,@current)) { |
if (grep(/^\Q$key\E$/,@current)) { |
$output .= '<td><label>'. |
$output .= '<td><label>'. |
'<input type="checkbox" name="adhocroledel" value="'.$key.'" />'. |
'<input type="checkbox" name="adhocroledel" value="'.$key.'" />'. |
&mt('Delete').'</label>'. |
&mt('Delete').'</label>'. |
'</td>'; |
'</td>'; |
} else { |
} else { |
$output .= '<td><label>'. |
$output .= '<td><label>'. |
'<input type="checkbox" name="adhocroleadd" value="'.$key.'" />'. |
'<input type="checkbox" name="adhocroleadd" value="'.$key.'" />'. |
&mt('Add').'</label>'. |
&mt('Add').'</label>'. |
'</td>'; |
'</td>'; |
|
} |
|
} |
} |
$output .= '<td>'.$key.'</td><td>'; |
$output .= '<td>'.$key.'</td><td>'; |
foreach my $level ('course','domain','system') { |
foreach my $level ('course','domain','system') { |
Line 615 sub courserequest_titles {
|
Line 603 sub courserequest_titles {
|
unofficial => 'Unofficial', |
unofficial => 'Unofficial', |
community => 'Communities', |
community => 'Communities', |
textbook => 'Textbook', |
textbook => 'Textbook', |
|
placement => 'Placement Tests', |
norequest => 'Not allowed', |
norequest => 'Not allowed', |
approval => 'Approval by Dom. Coord.', |
approval => 'Approval by Dom. Coord.', |
validate => 'With validation', |
validate => 'With validation', |
Line 751 sub print_username_entry_form {
|
Line 740 sub print_username_entry_form {
|
} elsif ($env{'form.action'} eq 'accesslogs') { |
} elsif ($env{'form.action'} eq 'accesslogs') { |
$helpitem = 'Domain_User_Access_Logs'; |
$helpitem = 'Domain_User_Access_Logs'; |
} |
} |
my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$defdom); |
my %breadcrumb_text = &singleuser_breadcrumb($crstype); |
if ($env{'form.action'} eq 'custom') { |
if ($env{'form.action'} eq 'custom') { |
push(@{$brcrum}, |
push(@{$brcrum}, |
{href=>"javascript:backPage(document.crtuser)", |
{href=>"javascript:backPage(document.crtuser)", |
Line 779 sub print_username_entry_form {
|
Line 768 sub print_username_entry_form {
|
'srst' => 'Search for a user and enroll as a student', |
'srst' => 'Search for a user and enroll as a student', |
'srme' => 'Search for a user and enroll as a member', |
'srme' => 'Search for a user and enroll as a member', |
'srad' => 'Search for a user and modify/add user information or roles', |
'srad' => 'Search for a user and modify/add user information or roles', |
'srvu' => 'Search for a user and view user information and roles', |
|
'srva' => 'Search for a user and view access log information', |
'srva' => 'Search for a user and view access log information', |
'usr' => "Username", |
'usr' => "Username", |
'dom' => "Domain", |
'dom' => "Domain", |
Line 835 sub print_username_entry_form {
|
Line 823 sub print_username_entry_form {
|
} |
} |
} elsif ($env{'form.action'} eq 'accesslogs') { |
} elsif ($env{'form.action'} eq 'accesslogs') { |
$actiontext = $lt{'srva'}; |
$actiontext = $lt{'srva'}; |
} elsif (($env{'form.action'} eq 'singleuser') && |
|
($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) { |
|
$actiontext = $lt{'srvu'}; |
|
} |
} |
$r->print("<h3>$actiontext</h3>"); |
$r->print("<h3>$actiontext</h3>"); |
if ($env{'form.origform'} ne 'crtusername') { |
if ($env{'form.origform'} ne 'crtusername') { |
Line 931 ENDBLOCK
|
Line 916 ENDBLOCK
|
} else { |
} else { |
$output = '<p>'.$userpicker.'</p>'; |
$output = '<p>'.$userpicker.'</p>'; |
} |
} |
if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs') && |
if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs')) { |
(!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && |
|
(!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) { |
|
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); |
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
Line 1050 ENDSCRIPT
|
Line 1033 ENDSCRIPT
|
'stusrch' => "User Search to enroll student", |
'stusrch' => "User Search to enroll student", |
'memsrch' => "User Search to enroll member", |
'memsrch' => "User Search to enroll member", |
'srcva' => "Search for a user and view access log information", |
'srcva' => "Search for a user and view access log information", |
'usrvu' => "User Search to view user roles", |
|
'usel' => "Select a user to add/modify roles", |
'usel' => "Select a user to add/modify roles", |
'suvr' => "Select a user to view roles", |
|
'stusel' => "Select a user to enroll as a student", |
'stusel' => "Select a user to enroll as a student", |
'memsel' => "Select a user to enroll as a member", |
'memsel' => "Select a user to enroll as a member", |
'vacsel' => "Select a user to view access log", |
'vacsel' => "Select a user to view access log", |
Line 1065 ENDSCRIPT
|
Line 1046 ENDSCRIPT
|
if ($context eq 'requestcrs') { |
if ($context eq 'requestcrs') { |
$r->print('<div>'); |
$r->print('<div>'); |
} else { |
} else { |
my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$srch->{'srchdomain'}); |
my %breadcrumb_text = &singleuser_breadcrumb($crstype); |
my $helpitem; |
my $helpitem; |
if ($env{'form.action'} eq 'singleuser') { |
if ($env{'form.action'} eq 'singleuser') { |
$helpitem = 'Course_Change_Privileges'; |
$helpitem = 'Course_Change_Privileges'; |
Line 1085 ENDSCRIPT
|
Line 1066 ENDSCRIPT
|
); |
); |
$r->print(&Apache::loncommon::start_page('User Management',$jscript,{bread_crumbs => $brcrum})); |
$r->print(&Apache::loncommon::start_page('User Management',$jscript,{bread_crumbs => $brcrum})); |
if ($env{'form.action'} eq 'singleuser') { |
if ($env{'form.action'} eq 'singleuser') { |
my $readonly; |
$r->print("<b>$lt{'usrch'}</b><br />"); |
if (($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$srch->{'srchdomain'}))) { |
|
$readonly = 1; |
|
$r->print("<b>$lt{'usrvu'}</b><br />"); |
|
} else { |
|
$r->print("<b>$lt{'usrch'}</b><br />"); |
|
} |
|
$r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,$crstype)); |
$r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,$crstype)); |
if ($readonly) { |
$r->print('<h3>'.$lt{'usel'}.'</h3>'); |
$r->print('<h3>'.$lt{'suvr'}.'</h3>'); |
|
} else { |
|
$r->print('<h3>'.$lt{'usel'}.'</h3>'); |
|
} |
|
} elsif ($env{'form.action'} eq 'singlestudent') { |
} elsif ($env{'form.action'} eq 'singlestudent') { |
$r->print($jscript."<b>"); |
$r->print($jscript."<b>"); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 1236 sub print_user_modification_page {
|
Line 1207 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.") |
.' '; |
.' ' |
if ($context eq 'domain') { |
.&mt('Please contact the [_1]helpdesk[_2] for assistance.' |
$response .= &mt('Please contact a [_1] for assistance.', |
,'<a href="'.$helplink.'">','</a>') |
&Apache::lonnet::plaintext('dc')); |
.'</p><br />'; |
} 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 1291 sub print_user_modification_page {
|
Line 1257 sub print_user_modification_page {
|
|
|
my $js = &validation_javascript($context,$ccdomain,$pjump_def,$crstype, |
my $js = &validation_javascript($context,$ccdomain,$pjump_def,$crstype, |
$groupslist,$newuser,$formname,\%loaditem); |
$groupslist,$newuser,$formname,\%loaditem); |
my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$ccdomain); |
my %breadcrumb_text = &singleuser_breadcrumb($crstype); |
my $helpitem = 'Course_Change_Privileges'; |
my $helpitem = 'Course_Change_Privileges'; |
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
$helpitem = 'Course_Add_Student'; |
$helpitem = 'Course_Add_Student'; |
Line 1501 ENDAUTH
|
Line 1467 ENDAUTH
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
} else { |
} else { |
if ($permission->{'cusr'}) { |
$title = &mt('Modify existing user: [_1] in domain [_2]', |
$title = &mt('Modify existing user: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
|
} else { |
|
$title = &mt('Existing user: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
'"'.$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 1529 ENDAUTH
|
Line 1489 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($ccdomain,$ccuname); |
&Apache::lonnet::is_advanced_user($ccuname,$ccdomain); |
if ((!$isauthor) && |
if ((!$isauthor) && |
((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) || |
(&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) |
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) && |
&& ($env{'request.role.domain'} eq $ccdomain)) { |
($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 1601 ENDNOTOOLSPRIV
|
Line 1558 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,$showcredits,$statuses); |
$roledom,$crstype); |
} |
} |
} ## 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 1623 ENDNOTOOLSPRIV
|
Line 1571 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"); |
} elsif ($permission->{'cusr'}) { |
} else { |
$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 1666 ENDNOTOOLSPRIV
|
Line 1614 ENDNOTOOLSPRIV
|
} |
} |
|
|
sub singleuser_breadcrumb { |
sub singleuser_breadcrumb { |
my ($crstype,$context,$domain) = @_; |
my ($crstype) = @_; |
my %breadcrumb_text; |
my %breadcrumb_text; |
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 1674 sub singleuser_breadcrumb {
|
Line 1622 sub singleuser_breadcrumb {
|
} else { |
} else { |
$breadcrumb_text{'search'} = 'Enroll a student'; |
$breadcrumb_text{'search'} = 'Enroll a student'; |
} |
} |
$breadcrumb_text{'userpicked'} = 'Select a user'; |
$breadcrumb_text{'userpicked'} = 'Select a user', |
$breadcrumb_text{'modify'} = 'Set section/dates'; |
$breadcrumb_text{'modify'} = 'Set section/dates', |
} elsif ($env{'form.action'} eq 'accesslogs') { |
} elsif ($env{'form.action'} eq 'accesslogs') { |
$breadcrumb_text{'search'} = 'View access logs for a user'; |
$breadcrumb_text{'search'} = 'View access logs for a user'; |
$breadcrumb_text{'userpicked'} = 'Select a user'; |
$breadcrumb_text{'userpicked'} = 'Select a user', |
$breadcrumb_text{'activity'} = 'Activity'; |
$breadcrumb_text{'activity'} = 'Activity', |
} elsif (($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && |
|
(!&Apache::lonnet::allowed('mau',$domain))) { |
|
$breadcrumb_text{'search'} = "View user's roles"; |
|
$breadcrumb_text{'userpicked'} = 'Select a user'; |
|
$breadcrumb_text{'modify'} = 'User roles'; |
|
} else { |
} else { |
$breadcrumb_text{'search'} = 'Create/modify a user'; |
$breadcrumb_text{'search'} = 'Create/modify a user'; |
$breadcrumb_text{'userpicked'} = 'Select a user'; |
$breadcrumb_text{'userpicked'} = 'Select a user', |
$breadcrumb_text{'modify'} = 'Set user role'; |
$breadcrumb_text{'modify'} = 'Set user role', |
} |
} |
return %breadcrumb_text; |
return %breadcrumb_text; |
} |
} |
Line 1758 sub validation_javascript {
|
Line 1701 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,$statuses) = @_; |
$showcredits) = @_; |
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 1837 sub display_existing_roles {
|
Line 1766 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 1852 sub display_existing_roles {
|
Line 1774 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); |
my $cid = $1.'_'.$2; |
my $cid = $1.'_'.$2; |
# $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). |
# $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). |
next if ($envkey =~ m{^/$match_domain/$match_courseid/[A-Za-z0-9]+_gr$}); |
|
my %coursedata= |
my %coursedata= |
&Apache::lonnet::coursedescription($cid); |
&Apache::lonnet::coursedescription($cid); |
if ($coursedir =~ /^$match_community$/) { |
if ($coursedir =~ /^$match_community$/) { |
Line 1916 sub display_existing_roles {
|
Line 1836 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+)}) { |
$csec = $2; |
$carea.='<br />'.&mt('Section: [_1]',$3); |
$carea.='<br />'.&mt('Section: [_1]',$csec); |
$sortkey.="\0$3"; |
$sortkey.="\0$csec"; |
|
if (!$allowed) { |
if (!$allowed) { |
if ($env{'request.course.sec'} eq $csec) { |
if ($env{'request.course.sec'} eq $3) { |
if (&Apache::lonnet::allowed('c'.$role_code,$1)) { |
if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) { |
$allowed = 1; |
$allowed = 1; |
} |
} |
} |
} |
Line 1964 sub display_existing_roles {
|
Line 1883 sub display_existing_roles {
|
} |
} |
} |
} |
my $row = ''; |
my $row = ''; |
if ($showall) { |
$row.= '<td>'; |
$row.= '<td>'; |
my $active=1; |
if (($active) && ($allowed)) { |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
if (($active) && ($allowed)) { |
} else { |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
if ($active) { |
} else { |
$row.=' '; |
if ($active) { |
} else { |
$row.=' '; |
$row.=&mt('expired or revoked'); |
|
} |
|
} |
|
$row.='</td><td>'; |
|
if ($allowed && !$active) { |
|
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
|
} else { |
|
$row.=' '; |
|
} |
|
$row.='</td><td>'; |
|
if ($delallowed) { |
|
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
|
} else { |
} else { |
$row.=' '; |
$row.=&mt('expired or revoked'); |
} |
} |
$row.= '</td>'; |
} |
|
$row.='</td><td>'; |
|
if ($allowed && !$active) { |
|
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
|
} else { |
|
$row.=' '; |
|
} |
|
$row.='</td><td>'; |
|
if ($delallowed) { |
|
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
|
} else { |
|
$row.=' '; |
} |
} |
my $plaintext=''; |
my $plaintext=''; |
if (!$croletitle) { |
if (!$croletitle) { |
Line 2005 sub display_existing_roles {
|
Line 1923 sub display_existing_roles {
|
'<br />', |
'<br />', |
$croleuname.':'.$croleudom); |
$croleuname.':'.$croleudom); |
} |
} |
$row.= '<td>'.$plaintext.'</td>'. |
$row.= '</td><td>'.$plaintext. |
'<td>'.$area.'</td>'. |
'</td><td>'.$area. |
'<td>'.($role_start_time?&Apache::lonlocal::locallocaltime($role_start_time) |
'</td><td>'.($role_start_time?&Apache::lonlocal::locallocaltime($role_start_time) |
: ' ' ).'</td>'. |
: ' ' ). |
'<td>'.($role_end_time ?&Apache::lonlocal::locallocaltime($role_end_time) |
'</td><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; |
if ($allowed) { |
$rolepriv{$envkey}=$allowed; |
$rolepriv{$envkey}='edit'; |
|
} else { |
|
if ($context eq 'domain') { |
|
if ((&Apache::lonnet::allowed('vur',$ccdomain)) && |
|
($envkey=~m{^/$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 2062 sub display_existing_roles {
|
Line 1966 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 { |
if ($showall) { |
$contextrole = &mt('Existing Roles in this Domain'); |
$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(). |
if ($showall) { |
'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}. |
$r->print( |
'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}. |
'<th>'.$lt{'rev'}.'</th><th>'.$lt{'ren'}.'</th><th>'.$lt{'del'}.'</th>' |
'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</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 2221 sub user_authentication {
|
Line 2112 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 2261 ENDBADAUTH
|
Line 2152 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 2271 ENDBADAUTH
|
Line 2167 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) && (&Apache::lonnet::allowed('mau',$ccdomain))) { |
if ($can_modify) { |
$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 2281 ENDBADAUTH
|
Line 2177 ENDBADAUTH
|
$outcome .= ' ('.$authformcurrent.')</td>'. |
$outcome .= ' ('.$authformcurrent.')</td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
foreach my $item (@authform_others) { |
foreach my $item (@authform_others) { |
$outcome .= &Apache::loncommon::start_data_table_row(). |
$outcome .= &Apache::loncommon::start_data_table_row(). |
'<td>'.$item.'</td>'. |
'<td>'.$item.'</td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&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('udp',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) { |
# 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 2705 sub update_user_data {
|
Line 2575 sub update_user_data {
|
$jsback."\n". |
$jsback."\n". |
'// ]]>'."\n". |
'// ]]>'."\n". |
'</script>'."\n"; |
'</script>'."\n"; |
my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$env{'form.ccdomain'}); |
my %breadcrumb_text = &singleuser_breadcrumb($crstype); |
push (@{$brcrum}, |
push (@{$brcrum}, |
{href => "javascript:backPage(document.userupdate)", |
{href => "javascript:backPage(document.userupdate)", |
text => $breadcrumb_text{'search'}, |
text => $breadcrumb_text{'search'}, |
Line 2814 sub update_user_data {
|
Line 2684 sub update_user_data {
|
my (%alerts,%rulematch,%inst_results,%curr_rules); |
my (%alerts,%rulematch,%inst_results,%curr_rules); |
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); |
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); |
my @usertools = ('aboutme','blog','webdav','portfolio'); |
my @usertools = ('aboutme','blog','webdav','portfolio'); |
my @requestcourses = ('official','unofficial','community','textbook'); |
my @requestcourses = ('official','unofficial','community','textbook','placement'); |
my @requestauthor = ('requestauthor'); |
my @requestauthor = ('requestauthor'); |
my ($othertitle,$usertypes,$types) = |
my ($othertitle,$usertypes,$types) = |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
Line 2993 sub update_user_data {
|
Line 2863 sub update_user_data {
|
'requestcourses.community','requestcourses.textbook', |
'requestcourses.community','requestcourses.textbook', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'requestauthor','adhocroles.'.$env{'request.role.domain'}], |
'reqcrsotherdom.placement','requestauthor', |
|
'adhocroles.'.$env{'request.role.domain'}], |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
if ($tmp =~ /^(con_lost|error)/i) { |
if ($tmp =~ /^(con_lost|error)/i) { |
Line 3296 sub update_user_data {
|
Line 3167 sub update_user_data {
|
($env{'user.domain'} eq $env{'form.ccdomain'})) { |
($env{'user.domain'} eq $env{'form.ccdomain'})) { |
my %newenvhash; |
my %newenvhash; |
foreach my $key (keys(%changed)) { |
foreach my $key (keys(%changed)) { |
if (($key eq 'official') || ($key eq 'unofficial') |
if (($key eq 'official') || ($key eq 'unofficial') || |
|| ($key eq 'community') || ($key eq 'textbook')) { |
($key eq 'community') || ($key eq 'textbook') || |
|
($key eq 'placement')) { |
$newenvhash{'environment.requestcourses.'.$key} = |
$newenvhash{'environment.requestcourses.'.$key} = |
$changeHash{'requestcourses.'.$key}; |
$changeHash{'requestcourses.'.$key}; |
if ($changeHash{'requestcourses.'.$key}) { |
if ($changeHash{'requestcourses.'.$key}) { |
Line 3366 sub update_user_data {
|
Line 3238 sub update_user_data {
|
\%newsettingstext); |
\%newsettingstext); |
if ($env{'form.cid'} ne $userenv{'id'}) { |
if ($env{'form.cid'} ne $userenv{'id'}) { |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
{$env{'form.ccuname'} => $env{'form.cid'}}); |
{$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids'); |
if (($recurseid) && |
if (($recurseid) && |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
my $idresult = |
my $idresult = |
Line 3509 sub display_userinfo {
|
Line 3381 sub display_userinfo {
|
'unofficial' => 'Can Request Unofficial Courses', |
'unofficial' => 'Can Request Unofficial Courses', |
'community' => 'Can Request Communities', |
'community' => 'Can Request Communities', |
'textbook' => 'Can Request Textbook Courses', |
'textbook' => 'Can Request Textbook Courses', |
|
'placement' => 'Can Request Placement Tests', |
'requestauthor' => 'Can Request Author Role', |
'requestauthor' => 'Can Request Author Role', |
'adhocroles' => 'Ad Hoc Roles Selectable via Helpdesk Role', |
'adhocroles' => 'Ad Hoc Roles Selectable via Helpdesk Role', |
'inststatus' => "Affiliation", |
'inststatus' => "Affiliation", |
Line 4549 sub custom_role_editor {
|
Line 4422 sub custom_role_editor {
|
); |
); |
my $args = { bread_crumbs => $brcrum, |
my $args = { bread_crumbs => $brcrum, |
bread_crumbs_component => 'User Management'}; |
bread_crumbs_component => 'User Management'}; |
|
|
$r->print(&Apache::loncommon::start_page('Custom Role Editor', |
$r->print(&Apache::loncommon::start_page('Custom Role Editor', |
$head_script,$args). |
$head_script,$args). |
$body_top); |
$body_top); |
Line 4755 sub handler {
|
Line 4628 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 5163 sub handler {
|
Line 5035 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') { |
if ($permission->{selfenrolladmin}) { |
push(@{$brcrum}, |
|
{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 => 'Enrollment requests', |
text => 'Result', |
help => 'Course_Self_Enrollment'}); |
help => 'Course_Self_Enrollment'}); |
$bread_crumbs_component = 'Enrollment requests'; |
$bread_crumbs_component = 'Enrollment result'; |
if ($env{'form.state'} eq 'done') { |
|
push(@{$brcrum}, |
|
{href => '/adm/createuser?action=selfenrollqueue', |
|
text => 'Result', |
|
help => 'Course_Self_Enrollment'}); |
|
$bread_crumbs_component = 'Enrollment result'; |
|
} |
|
$args = { bread_crumbs => $brcrum, |
|
bread_crumbs_component => $bread_crumbs_component}; |
|
$r->print(&header(undef,$args)); |
|
my $cid = $env{'request.course.id'}; |
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
|
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $coursedesc = $env{'course.'.$cid.'.description'}; |
|
if (!exists($env{'form.state'})) { |
|
$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>'); |
|
} |
} |
|
$args = { bread_crumbs => $brcrum, |
} elsif ($env{'form.action'} eq 'changelogs') { |
bread_crumbs_component => $bread_crumbs_component}; |
if ($permission->{cusr} || $permission->{view}) { |
$r->print(&header(undef,$args)); |
&print_userchangelogs_display($r,$context,$permission,$brcrum); |
my $cid = $env{'request.course.id'}; |
} else { |
my $cdom = $env{'course.'.$cid.'.domain'}; |
$r->print(&header(undef,{'no_nav_bar' => 1}). |
my $cnum = $env{'course.'.$cid.'.num'}; |
'<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>'); |
my $coursedesc = $env{'course.'.$cid.'.description'}; |
|
if (!exists($env{'form.state'})) { |
|
$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)); |
} |
} |
|
} elsif ($env{'form.action'} eq 'changelogs') { |
|
&print_userchangelogs_display($r,$context,$permission,$brcrum); |
} else { |
} else { |
$bread_crumbs_component = 'User Management'; |
$bread_crumbs_component = 'User Management'; |
$args = { bread_crumbs => $brcrum, |
$args = { bread_crumbs => $brcrum, |
Line 5455 sub print_main_menu {
|
Line 5316 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 5484 sub print_main_menu {
|
Line 5324 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->{'view'} || $permission->{'cusr'}), |
permission => $permission->{'cusr'}, |
linktitle => $linktitles{$linkcontext}{'singleuser'}, |
linktitle => $linktitles{$linkcontext}{'singleuser'}, |
}, |
}, |
]}, |
]}, |
Line 5520 sub print_main_menu {
|
Line 5360 sub print_main_menu {
|
{ |
{ |
linktext => 'User Access Log', |
linktext => 'User Access Log', |
icon => 'document-properties.png', |
icon => 'document-properties.png', |
#help => 'Domain_User_Access_Logs', |
#help => 'User_Access_Logs', |
url => '/adm/createuser?action=accesslogs', |
url => '/adm/createuser?action=accesslogs', |
permission => $permission->{'activity'}, |
permission => $permission->{'activity'}, |
linktitle => 'View user access log.', |
linktitle => 'View user access log.', |
Line 5557 sub print_main_menu {
|
Line 5397 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->{'view'}), |
permission => $permission->{'cusr'}, |
linktitle => 'View change log.', |
linktitle => 'View change log.', |
}, |
}, |
); |
); |
Line 5577 sub print_main_menu {
|
Line 5417 sub print_main_menu {
|
groups => 'Community Groups', |
groups => 'Community Groups', |
}, |
}, |
); |
); |
|
$linktext{'Placement'} = $linktext{'Course'}; |
|
|
my %linktitle = ( |
my %linktitle = ( |
'Course' => { |
'Course' => { |
Line 5591 sub print_main_menu {
|
Line 5432 sub print_main_menu {
|
}, |
}, |
); |
); |
|
|
|
$linktitle{'Placement'} = $linktitle{'Course'}; |
|
|
push(@{ $menu[0]->{items} }, #Category: Single Users |
push(@{ $menu[0]->{items} }, #Category: Single Users |
{ |
{ |
linktext => $linktext{$crstype}{'single'}, |
linktext => $linktext{$crstype}{'single'}, |
Line 5634 sub print_main_menu {
|
Line 5477 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->{'view'} || $permission->{'cusr'}), |
permission => $permission->{'cusr'}, |
linktitle => 'View change log.', |
linktitle => 'View change log.', |
}, |
}, |
); |
); |
Line 5659 sub print_main_menu {
|
Line 5502 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 5709 sub restore_prev_selections {
|
Line 5551 sub restore_prev_selections {
|
} |
} |
|
|
sub print_selfenroll_menu { |
sub print_selfenroll_menu { |
my ($r,$context,$cid,$cdom,$cnum,$currsettings,$additional,$readonly) = @_; |
my ($r,$context,$cid,$cdom,$cnum,$currsettings,$additional) = @_; |
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 5722 sub print_selfenroll_menu {
|
Line 5564 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 6041 ENDSCRIPT
|
Line 5879 ENDSCRIPT
|
$output .= ' checked="checked" '; |
$output .= ' checked="checked" '; |
} |
} |
$output .= 'onchange="javascript:update_types('. |
$output .= 'onchange="javascript:update_types('. |
"'selfenroll_all'".');"'.$disabled.' />'.&mt('Yes').'</label>'. |
"'selfenroll_all'".');" />'.&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'".');"'.$disabled.' />'.&mt('No').'</label></td>'. |
"'selfenroll_all'".');"/>'.&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 6069 ENDSCRIPT
|
Line 5907 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'".');"'.$disabled.' />' |
.'name="selfenroll_delete" value="'.$num.'" onchange="javascript:update_types('."'selfenroll_delete','$num'".');" />' |
.&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,$readonly).'</td>' |
.&selfenroll_inst_types($num,$currdom,\@currinsttypes).'</td>' |
.&Apache::loncommon::end_data_table_row(); |
.&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
} |
} |
Line 6087 ENDSCRIPT
|
Line 5925 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,'','','',$readonly) |
$includeempty,$showdomdesc) |
.'<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 6108 ENDSCRIPT
|
Line 5946 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.$disabled.' />'. |
'<input type="radio" name="selfenroll_registered" value="1"'.$regon.'/>'. |
&mt('Yes').'</label> <label>'. |
&mt('Yes').'</label> <label>'. |
'<input type="radio" name="selfenroll_registered" value="0"'.$regoff.$disabled.' />'. |
'<input type="radio" name="selfenroll_registered" value="0"'.$regoff.'/>'. |
&mt('No').'</label>'; |
&mt('No').'</label>'; |
} elsif ($item eq 'enroll_dates') { |
} elsif ($item eq 'enroll_dates') { |
my ($starttime,$endtime); |
my ($starttime,$endtime); |
Line 6138 ENDSCRIPT
|
Line 5976 ENDSCRIPT
|
} |
} |
my $startform = |
my $startform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_date',$starttime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_date',$starttime, |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
undef,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, |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
undef,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 6163 ENDSCRIPT
|
Line 6001 ENDSCRIPT
|
} |
} |
my $startform = |
my $startform = |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_access',$starttime, |
&Apache::lonhtmlcommon::date_setter($formname,'selfenroll_start_access',$starttime, |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
undef,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, |
$disabled,undef,undef,undef,undef,undef,undef,$nolink); |
undef,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 6190 ENDSCRIPT
|
Line 6028 ENDSCRIPT
|
next; |
next; |
} |
} |
my $sections_select = |
my $sections_select = |
&Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec,$disabled); |
&Apache::lonuserutils::course_sections(\%sections_count,'st',$currsec); |
$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.'"'.$disabled.' />'."\n". |
'<input type="text" name="newsec" size="15" value="'.$newsecval.'" />'."\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 6218 ENDSCRIPT
|
Line 6056 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();"'.$disabled.' />'. |
$appchecked{$i}.' onclick="toggleNotify();" />'.$selfdescs{'approval'}{$i}. |
$selfdescs{'approval'}{$i}.'</label>'.(' 'x2); |
'</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 6260 ENDSCRIPT
|
Line 6098 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.'"'.$disabled.' />'. |
'<input type="checkbox" name="selfenroll_notify"'.$notifyon.' value="'.$cc.'" />'. |
&Apache::loncommon::plainname($ccuname,$ccudom). |
&Apache::loncommon::plainname($ccuname,$ccudom). |
'</label></span></td>'; |
'</label></span></td>'; |
$count ++; |
$count ++; |
Line 6310 ENDSCRIPT
|
Line 6148 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.$disabled.'/>'. |
'<input type="radio" name="selfenroll_limit" value="none"'.$nolimit.'/>'. |
&mt('No limit').'</label></td><td><label>'. |
&mt('No limit').'</label></td><td><label>'. |
'<input type="radio" name="selfenroll_limit" value="allstudents"'.$crslimit.$disabled.'/>'. |
'<input type="radio" name="selfenroll_limit" value="allstudents"'.$crslimit.'/>'. |
&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.$disabled.'/>'. |
'<input type="radio" name="selfenroll_limit" value="selfenrolled"'.$selflimit.'/>'. |
&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.'"'.$disabled.' /></td></tr></table>'; |
'<input type="text" name="selfenroll_cap" size = "5" value="'.$currcap.'" /></td></tr></table>'; |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
} |
} |
} |
} |
$output .= &Apache::lonhtmlcommon::end_pick_box().'<br />'; |
$output .= &Apache::lonhtmlcommon::end_pick_box(). |
unless ($readonly) { |
'<br /><input type="button" name="selfenrollconf" value="' |
$output .= '<input type="button" name="selfenrollconf" value="' |
.&mt('Save').'" onclick="validate_types(this.form);" />' |
.&mt('Save').'" onclick="validate_types(this.form);" />'; |
.'<input type="hidden" name="action" value="selfenroll" />' |
} |
.'<input type="hidden" name="state" value="done" />'."\n". |
$output .= '<input type="hidden" name="action" value="selfenroll" />' |
$additional.'</form>'; |
.'<input type="hidden" name="state" value="done" />'."\n" |
|
.$additional.'</form>'; |
|
$r->print($output); |
$r->print($output); |
return; |
return; |
} |
} |
Line 6514 sub new_selfenroll_dom_row {
|
Line 6350 sub new_selfenroll_dom_row {
|
} |
} |
|
|
sub selfenroll_inst_types { |
sub selfenroll_inst_types { |
my ($num,$currdom,$currinsttypes,$readonly) = @_; |
my ($num,$currdom,$currinsttypes) = @_; |
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 6548 sub selfenroll_inst_types {
|
Line 6380 sub selfenroll_inst_types {
|
$output .= 'checked="checked"'; |
$output .= 'checked="checked"'; |
} |
} |
} |
} |
$output .= ' name="selfenroll_types_'.$num.'"'.$disabled.' />'.$usertypes->{$type}.'</label></span></td>'; |
$output .= ' name="selfenroll_types_'.$num.'" />'.$usertypes->{$type}.'</label></span></td>'; |
} |
} |
$count ++; |
$count ++; |
} |
} |
Line 6571 sub selfenroll_inst_types {
|
Line 6403 sub selfenroll_inst_types {
|
} else { |
} else { |
$output .= ' checked="checked"'; |
$output .= ' checked="checked"'; |
} |
} |
$output .= ' name="selfenroll_types_'.$num.'"'.$disabled.' />'.$othertitle.'</label></span></td></tr></table>'; |
$output .= ' name="selfenroll_types_'.$num.'" />'.$othertitle.'</label></span></td></tr></table>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 6594 sub selfenroll_date_forms {
|
Line 6426 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,$viewablesec,%roleslog); |
my ($username,$domain,$crstype,%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 6603 sub print_userchangelogs_display {
|
Line 6435 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 6735 ENDSCRIPT
|
Line 6566 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 6825 sub print_useraccesslogs_display {
|
Line 6653 sub print_useraccesslogs_display {
|
my $form = 'document.accesslog'; |
my $form = 'document.accesslog'; |
|
|
# set breadcrumbs |
# set breadcrumbs |
my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom); |
my %breadcrumb_text = &singleuser_breadcrumb(); |
push (@{$brcrum}, |
push (@{$brcrum}, |
{href => "javascript:backPage($form)", |
{href => "javascript:backPage($form)", |
text => $breadcrumb_text{'search'}}); |
text => $breadcrumb_text{'search'}}); |
Line 6845 sub print_useraccesslogs_display {
|
Line 6673 sub print_useraccesslogs_display {
|
push(@{$brcrum}, |
push(@{$brcrum}, |
{href => '/adm/createuser?action=accesslogs', |
{href => '/adm/createuser?action=accesslogs', |
text => 'User access logs', |
text => 'User access logs', |
help => 'Domain_User_Access_Logs'}); |
help => 'User_Access_Logs'}); |
my $bread_crumbs_component = 'User Access Logs'; |
my $bread_crumbs_component = 'User Access Logs'; |
my $args = { bread_crumbs => $brcrum, |
my $args = { bread_crumbs => $brcrum, |
bread_crumbs_component => 'User Management'}; |
bread_crumbs_component => 'User Management'}; |
if ($env{'form.popup'}) { |
|
$args->{'no_nav_bar'} = 1; |
|
} |
|
|
|
# set javascript |
# set javascript |
my ($jsback,$elements) = &crumb_utilities(); |
my ($jsback,$elements) = &crumb_utilities(); |
Line 6980 ENDSCRIPT
|
Line 6805 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)(?:/(\w+)|)$}) { |
if ($extent =~ m{^/($match_domain)/($match_courseid)$}) { |
my ($cdom,$cnum,$sec) = ($1,$2,$3); |
my ($cdom,$cnum) = ($1,$2); |
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 7006 ENDSCRIPT
|
Line 6831 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') { |
Line 7057 ENDSCRIPT
|
Line 6879 ENDSCRIPT
|
.'</p>'); |
.'</p>'); |
} |
} |
|
|
if ($env{'form.popup'} == 1) { |
|
$r->print('<input type="hidden" name="popup" value="1" />'."\n"); |
|
} |
|
|
|
# Form Footer |
# Form Footer |
$r->print( |
$r->print( |
'<input type="hidden" name="currstate" value="" />' |
'<input type="hidden" name="currstate" value="" />' |
Line 7780 sub build_search_response {
|
Line 7598 sub build_search_response {
|
.&mt("Click 'Search'") |
.&mt("Click 'Search'") |
.'</li></ul><br />'; |
.'</li></ul><br />'; |
} else { |
} else { |
unless (($context eq 'domain') && ($env{'form.action'} eq 'singleuser')) { |
my $helplink = ' href="javascript:helpMenu('."'display'".')"'; |
my $helplink = ' href="javascript:helpMenu('."'display'".')"'; |
$response .= '<br /><br />'; |
$response .= '<br /><br />'; |
if ($context eq 'requestcrs') { |
if ($context eq 'requestcrs') { |
$response .= &mt("You are not authorized to define new users in the new course's domain - [_1].",$targetdom); |
$response .= &mt("You are not authorized to define new users in the new course's domain - [_1].",$targetdom); |
} else { |
} else { |
$response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom); |
$response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom); |
|
} |
|
$response .= '<br />' |
|
.&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.' |
|
,' <a'.$helplink.'>' |
|
,'</a>') |
|
.'<br />'; |
|
} |
} |
|
$response .= '<br />' |
|
.&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.' |
|
,' <a'.$helplink.'>' |
|
,'</a>') |
|
.'<br />'; |
} |
} |
} |
} |
} |
} |