--- loncom/lonnet/perl/lonnet.pm	2000/11/16 12:00:01	1.65
+++ loncom/lonnet/perl/lonnet.pm	2000/11/22 12:14:56	1.68
@@ -67,7 +67,7 @@
 # 10/04 Gerd Kortemeyer
 # 10/04 Guy Albertelli
 # 10/06,10/09,10/10,10/11,10/14,10/20,10/23,10/25,10/26,10/27,10/28,10/29, 
-# 10/30,10/31,11/2,11/14,11/15,11/16 Gerd Kortemeyer
+# 10/30,10/31,11/2,11/14,11/15,11/16,11/20,11/21,11/22 Gerd Kortemeyer
 
 package Apache::lonnet;
 
@@ -776,8 +776,9 @@ sub allowed {
     }
 
 # Course: uri itself is a course
-
-    if ($ENV{'user.priv.'.$ENV{'request.role'}.'./'.$uri}
+    my $courseuri=$uri;
+    $courseuri=~s/\_(\d)/\/$1/;
+    if ($ENV{'user.priv.'.$ENV{'request.role'}.'./'.$courseuri}
        =~/$priv\&([^\:]*)/) {
        $thisallowed.=$1;
     }
@@ -1193,6 +1194,7 @@ sub condval {
 
 sub EXT {
     my $varname=shift;
+    unless ($varname) { return ''; }
     my ($realm,$space,$qualifier,@therest)=split(/\./,$varname);
     my $rest;
     if ($therest[0]) {
@@ -1307,7 +1309,7 @@ sub EXT {
      
 # --------------------------------------------- last, look in resource metadata
 	my $uri=&declutter($ENV{'request.filename'});
-        my $filename=$perlvar{'lonDocRoot'}.'/res/'.$ENV.'.meta';
+        my $filename=$perlvar{'lonDocRoot'}.'/res/'.$uri.'.meta';
         if (-e $filename) {
             my @content;
             {