[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /interface lonpreferences.pm lonwhatsnew.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 06 Jan 2006 21:04:35 -0000
albertel Fri Jan 6 16:04:35 2006 EDT
Modified files:
/loncom/auth lonroles.pm
/loncom/interface lonpreferences.pm lonwhatsnew.pm
Log:
- check whn for both course and course+section
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.144 loncom/auth/lonroles.pm:1.145
--- loncom/auth/lonroles.pm:1.144 Fri Jan 6 16:03:23 2006
+++ loncom/auth/lonroles.pm Fri Jan 6 16:04:33 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.144 2006/01/06 21:03:23 albertel Exp $
+# $Id: lonroles.pm,v 1.145 2006/01/06 21:04:33 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -273,7 +273,11 @@
# Send the user to the course they selected
} elsif ($env{'request.course.id'}) {
if (&Apache::lonnet::allowed('whn',
- $env{'request.course.id'})) {
+ $env{'request.course.id'})
+ || &Apache::lonnet::allowed('whn',
+ $env{'request.course.id'}.'/'
+ .$env{'request.course.sec'})
+ ) {
my $startpage = &courseloadpage($courseid);
unless ($startpage eq 'firstres') {
$msg = &mt('Entering course ....');
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.73 loncom/interface/lonpreferences.pm:1.74
--- loncom/interface/lonpreferences.pm:1.73 Fri Jan 6 14:05:30 2006
+++ loncom/interface/lonpreferences.pm Fri Jan 6 16:04:34 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.73 2006/01/06 19:05:30 albertel Exp $
+# $Id: lonpreferences.pm,v 1.74 2006/01/06 21:04:34 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1233,7 +1233,9 @@
text => 'Change Math Preferences'},
printmenu => 'yes',
}));
- if ($env{'user.adv'}) {
+ if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})
+ || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'
+ .$env{'request.course.sec'})) {
push (@Options,({ action => 'changecourseinit',
linktext => 'Change Course Initialization Preference',
href => '/adm/preferences',
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.42 loncom/interface/lonwhatsnew.pm:1.43
--- loncom/interface/lonwhatsnew.pm:1.42 Wed Dec 21 22:39:39 2005
+++ loncom/interface/lonwhatsnew.pm Fri Jan 6 16:04:34 2006
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.42 2005/12/22 03:39:39 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.43 2006/01/06 21:04:34 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,12 +60,13 @@
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- my $crsid = $env{'request.course.id'};
- $crsid =~ s/_/\//;
- if ((!($env{'request.course.fn'})) ||
- (!(&Apache::lonnet::allowed('whn',
- $env{'request.course.id'})))) {
- # Not in a course, or no role in course
+
+ if ( ! $env{'request.course.fn'}
+ ||
+ (!( &Apache::lonnet::allowed('whn',$env{'request.course.id'})
+ || &Apache::lonnet::allowed('whn',$env{'request.course.id'}
+ .'/'.$env{'request.course.sec'})))) {
+ # Not in a course, or no whn priv in course
$env{'user.error.msg'}="/adm/whatsnew::whn:0:0:Cannot display what's new page";
return HTTP_NOT_ACCEPTABLE;
}