--- loncom/interface/lonwhatsnew.pm 2005/12/20 15:56:38 1.40 +++ loncom/interface/lonwhatsnew.pm 2006/01/06 21:04:34 1.43 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.40 2005/12/20 15:56:38 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,14 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - my $crsid = $env{'request.course.id'}; - $crsid =~ s/_/\//; - if ((!($env{'request.course.id'})) || - ($env{'request.role'} !~ /\Q$crsid\E$/)) { - # Not in a course, or no role in course - $env{'user.error.msg'}="/adm/whatsnew::0:0:Cannot display what's new screen"; + + 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; } @@ -1401,9 +1403,9 @@ sub get_display_settings { my ($tmp) = keys(%settings); if ($tmp=~ /^(con_lost|error|no_such_host)/i) { %settings = (); - unless ($tmp eq 'error: 2 tie(GDBM) Failed while attempting dump') { - &logthis('Error retrieving whatsnew settings: '.$tmp.' for '. - $uname.':'.$udom.' for course: '.$cid); + unless ($tmp =~ /^error: 2 /) { + &Apache::lonnet::logthis('Error retrieving whatsnew settings: '. + $tmp.' for '.$uname.':'.$udom.' for course: '.$cid); } } return %settings;