[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 14 Jun 2002 20:47:45 -0000


www		Fri Jun 14 16:47:45 2002 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Respects (priv).users.denied in addition to (priv).roles.denied where
  privilege is "C" (conditional)
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.236 loncom/lonnet/perl/lonnet.pm:1.237
--- loncom/lonnet/perl/lonnet.pm:1.236	Wed Jun  5 16:40:10 2002
+++ loncom/lonnet/perl/lonnet.pm	Fri Jun 14 16:47:45 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.236 2002/06/05 20:40:10 www Exp $
+# $Id: lonnet.pm,v 1.237 2002/06/14 20:47:45 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1684,10 +1684,19 @@
 
    if ($thisallowed=~/C/) {
        my $rolecode=(split(/\./,$ENV{'request.role'}))[0];
+       my $unamedom=$ENV{'user.name'}.':'.$ENV{'user.domain'};
        if ($ENV{'course.'.$ENV{'request.course.id'}.'.'.$priv.'.roles.denied'}
 	   =~/$rolecode/) {
            &log($ENV{'user.domain'},$ENV{'user.name'},$ENV{'user.host'},
                 'Denied by role: '.$priv.' for '.$uri.' as '.$rolecode.' in '.
+                $ENV{'request.course.id'});
+           return '';
+       }
+
+       if ($ENV{'course.'.$ENV{'request.course.id'}.'.'.$priv.'.users.denied'}
+	   =~/$unamedom/) {
+           &log($ENV{'user.domain'},$ENV{'user.name'},$ENV{'user.host'},
+                'Denied by user: '.$priv.' for '.$uri.' as '.$unamedom.' in '.
                 $ENV{'request.course.id'});
            return '';
        }