[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm lonblockingmenu.pm lonblockingstatus.pm loncommon.pm lonindexcourse.pm
raeburn
raeburn at source.lon-capa.org
Tue Dec 31 14:28:30 EST 2024
raeburn Tue Dec 31 19:28:30 2024 EDT
Modified files:
/loncom/interface domainprefs.pm lonblockingmenu.pm
lonblockingstatus.pm loncommon.pm
lonindexcourse.pm
Log:
- For IP-based access control set in a domain, blocked functionality in a
course can include display of a content index, indexed by keyword.
- Blocking Communication/Resource Access in a course can include blocking
display of a content index, indexed by keyword.
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.446 loncom/interface/domainprefs.pm:1.447
--- loncom/interface/domainprefs.pm:1.446 Tue Dec 31 18:51:53 2024
+++ loncom/interface/domainprefs.pm Tue Dec 31 19:28:29 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.446 2024/12/31 18:51:53 raeburn Exp $
+# $Id: domainprefs.pm,v 1.447 2024/12/31 19:28:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2009,10 +2009,11 @@
'passwd' => 'Change Password',
'grades' => 'Gradebook',
'search' => 'Course search',
+ 'index' => 'Course content index',
'wishlist' => 'Stored links',
'annotate' => 'Annotations',
);
- my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','annotate','passwd'];
+ my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','index','annotate','passwd'];
return ($typeorder,\%types);
}
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.31 loncom/interface/lonblockingmenu.pm:1.32
--- loncom/interface/lonblockingmenu.pm:1.31 Fri Dec 20 00:24:38 2024
+++ loncom/interface/lonblockingmenu.pm Tue Dec 31 19:28:29 2024
@@ -2,7 +2,7 @@
# Routines for configuring blocking of access to collaborative functions,
# and specific resources during an exam
#
-# $Id: lonblockingmenu.pm,v 1.31 2024/12/20 00:24:38 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.32 2024/12/31 19:28:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -623,6 +623,7 @@
'<li>'.&mt("generating printouts of $lctype content").'</li>'.
'<li>'.&mt("displaying the LON-CAPA gradebook in the $lctype").'</li>'.
'<li>'.&mt("searching $lctype content by keyword").'</li>'.
+ '<li>'.&mt("displaying $lctype content indexed by keyword").'</li>'.
'<li>'.&mt("accessing $lctype content in specified folders or resources").'</li>'.
'<li>'.&mt("changing user's own password").'</li>'.
'</ul>'.
@@ -1661,10 +1662,11 @@
'passwd' => 'Change Password',
'grades' => 'Gradebook',
'search' => 'Content Search',
+ 'index' => 'Content Index',
'alert' => 'Critical Alert',
'reinit' => 'Course Re-init',
);
- my $typeorder = ['com','chat','boards','port','groups','blogs','about','printout','docs','grades','search','alert','reinit','passwd'];
+ my $typeorder = ['com','chat','boards','port','groups','blogs','about','printout','docs','grades','search','index','alert','reinit','passwd'];
return ($typeorder,\%types);
}
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.22 loncom/interface/lonblockingstatus.pm:1.23
--- loncom/interface/lonblockingstatus.pm:1.22 Fri Dec 24 00:48:30 2021
+++ loncom/interface/lonblockingstatus.pm Tue Dec 31 19:28:29 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# displays the blocking status table
#
-# $Id: lonblockingstatus.pm,v 1.22 2021/12/24 00:48:30 raeburn Exp $
+# $Id: lonblockingstatus.pm,v 1.23 2024/12/31 19:28:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,7 +44,7 @@
return OK if $r->header_only;
my (%activities,$activity,$origurl,$origsymb);
- map { $activities{$_} = 1; } ('boards','chat','com','blogs','about','groups','port','printout','docs','grades','passwd','search','wishlist','annotate');
+ map { $activities{$_} = 1; } ('boards','chat','com','blogs','about','groups','port','printout','docs','grades','passwd','search','index','wishlist','annotate');
# determine what kind of blocking we want details for
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity','url','symb']);
@@ -55,7 +55,7 @@
if (($activity eq 'docs') || ($activity eq 'printout') ||
($activity eq 'grades') || ($activity eq 'passwd') ||
($activity eq 'search') || ($activity eq 'wishlist') ||
- ($activity eq 'annotate')) {
+ ($activity eq 'annotate') || ($activity eq 'index')) {
$title = 'Blocking Status Information';
if ($activity eq 'docs') {
$origurl = $env{'form.url'};
@@ -165,6 +165,7 @@
passwd => 'Changing of passwords',
grades => 'Course Gradebook',
search => 'Content Search',
+ index => 'Content Index',
wishlist => 'Stored Links',
annotate => 'Annotations',
);
@@ -202,7 +203,7 @@
} elsif (($activity eq 'printout') || ($activity eq 'passwd') ||
($activity eq 'grades') || ($activity eq 'search') ||
($activity eq 'about') || ($activity eq 'wishlist') ||
- ($activity eq 'annotate')) {
+ ($activity eq 'annotate') || ($activity eq 'index')) {
if ($by_ip) {
$output = mt( $description
. ' unavailable from your current IP address: [_1] '
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1443 loncom/interface/loncommon.pm:1.1444
--- loncom/interface/loncommon.pm:1.1443 Sun Oct 13 22:14:58 2024
+++ loncom/interface/loncommon.pm Tue Dec 31 19:28:29 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1443 2024/10/13 22:14:58 raeburn Exp $
+# $Id: loncommon.pm,v 1.1444 2024/12/31 19:28:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5691,7 +5691,8 @@
}
unless ($has_evb) {
if (($activity eq 'printout') || ($activity eq 'grades') || ($activity eq 'search') ||
- ($activity eq 'boards') || ($activity eq 'groups') || ($activity eq 'chat')) {
+ ($activity eq 'index') || ($activity eq 'boards') || ($activity eq 'groups') ||
+ ($activity eq 'chat')) {
if ($udom eq $cdom) {
$check_ipaccess = 1;
}
@@ -5782,8 +5783,8 @@
if (($activity eq 'boards' || $activity eq 'chat' ||
$activity eq 'groups' || $activity eq 'printout' ||
- $activity eq 'search' || $activity eq 'reinit' ||
- $activity eq 'alert') &&
+ $activity eq 'search' || $activity eq 'index' ||
+ $activity eq 'reinit' || $activity eq 'alert') &&
($env{'request.course.id'})) {
foreach my $key (keys(%live_courses)) {
if ($key ne $env{'request.course.id'}) {
@@ -6118,6 +6119,8 @@
$text = &mt('Gradebook Blocked');
} elsif ($activity eq 'search') {
$text = &mt('Search Blocked');
+ } elsif ($activity eq 'index') {
+ $text = &mt('Content Index Blocked');
} elsif ($activity eq 'alert') {
$text = &mt('Checking Critical Messages Blocked');
} elsif ($activity eq 'reinit') {
Index: loncom/interface/lonindexcourse.pm
diff -u loncom/interface/lonindexcourse.pm:1.4 loncom/interface/lonindexcourse.pm:1.5
--- loncom/interface/lonindexcourse.pm:1.4 Mon Feb 12 04:04:06 2024
+++ loncom/interface/lonindexcourse.pm Tue Dec 31 19:28:29 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Index Course
#
-# $Id: lonindexcourse.pm,v 1.4 2024/02/12 04:04:06 raeburn Exp $
+# $Id: lonindexcourse.pm,v 1.5 2024/12/31 19:28:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -171,7 +171,26 @@
text => "$crstype Index"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index"));
&Apache::lonnavdisplay::startContentScreen($r,'courseindex');
- &course_index($r);
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('index',$clientip,$cnum,$cdom);
+ if ($blocked) {
+ my $checkrole = "cm./$cdom/$cnum";
+ if ($env{'request.course.sec'} ne '') {
+ $checkrole .= "/$env{'request.course.sec'}";
+ }
+ if ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) &&
+ ($env{'request.role'} !~ m{^st\./$cdom/$cnum})) {
+ undef($blocked);
+ }
+ }
+ if ($blocked) {
+ $r->print($blocktext);
+ } else {
+ &course_index($r);
+ }
&Apache::lonnavdisplay::endContentScreen($r);
$r->print(&Apache::loncommon::end_page());
return OK;
More information about the LON-CAPA-cvs
mailing list