[LON-CAPA-cvs] cvs: loncom /auth loncacc.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 01 Feb 2007 07:13:59 -0000


albertel		Thu Feb  1 02:13:59 2007 EDT

  Modified files:              
    /loncom/auth	loncacc.pm 
  Log:
  - errr meant to only commit lonracc.pm
  
  
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.44 loncom/auth/loncacc.pm:1.45
--- loncom/auth/loncacc.pm:1.44	Thu Feb  1 02:13:04 2007
+++ loncom/auth/loncacc.pm	Thu Feb  1 02:13:59 2007
@@ -2,7 +2,7 @@
 # Cookie Based Access Handler for Construction Area
 # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
 #
-# $Id: loncacc.pm,v 1.44 2007/02/01 07:13:04 albertel Exp $
+# $Id: loncacc.pm,v 1.45 2007/02/01 07:13:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -32,14 +32,15 @@
 use strict;
 use Apache::Constants qw(:common :http :methods REDIRECT);
 use CGI::Cookie();
+use Fcntl qw(:flock);
 use Apache::lonlocal;
 use Apache::lonnet;
-use Apache::lonacc();
+use Apache::lonacc;
 use LONCAPA qw(:DEFAULT :match);
 
 sub constructaccess {
     my ($url,$ownerdomain)=@_;
-    my ($ownername)=($url=~m{/(?:\~|priv/|home/)($match_username)/});
+    my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)($match_username)\//);
     unless (($ownername) && ($ownerdomain)) { return ''; }
     # We do not allow editing of previous versions of files.
     if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }
@@ -47,25 +48,22 @@
     if ($ownername eq $env{'user.name'}) {
 	foreach my $domain (@possibledomains) {
 	    if ($domain eq $env{'user.domain'}) {
-    &Apache::lonnet::logthis("good1!");
 		return ($ownername,$domain);
 	    }
 	}
     }
+    
     foreach my $domain (@possibledomains) {
 	if (exists($env{'user.priv.ca./'.$domain.'/'.$ownername.'./'}) ||
 	    exists($env{'user.priv.aa./'.$domain.'/'.$ownername.'./'}) ) {
-    &Apache::lonnet::logthis("good2!");
 	    return ($ownername,$domain);
 	}
     }
-    &Apache::lonnet::logthis("boo! hiss!");
     return '';
 }
 
 sub handler {
     my $r = shift;
-
     my $requrl=$r->uri;
     $env{'request.editurl'}=$requrl;
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));