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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 12 Jul 2005 07:00:30 -0000


albertel		Tue Jul 12 03:00:30 2005 EDT

  Modified files:              
    /loncom/auth	loncacc.pm 
  Log:
  - speeding up cstr access (this was cycling through everthing in %env twice per each domain on the machine)
  
  
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.39 loncom/auth/loncacc.pm:1.40
--- loncom/auth/loncacc.pm:1.39	Sat Jun 18 20:41:32 2005
+++ loncom/auth/loncacc.pm	Tue Jul 12 03:00:28 2005
@@ -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.39 2005/06/19 00:41:32 www Exp $
+# $Id: loncacc.pm,v 1.40 2005/07/12 07:00:28 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -54,17 +54,9 @@
     }
     
     foreach my $domain (@possibledomains) {
-	my $capriv='user.priv.ca./'.$domain.'/'.$ownername.'./';
-	foreach (keys %env) {
-	    if ($_ eq $capriv) {
-		return ($ownername,$domain);
-	    }
-	}
-	my $aapriv='user.priv.aa./'.$domain.'/'.$ownername.'./';
-	foreach (keys %env) {
-	    if ($_ eq $aapriv) {
-		return ($ownername,$domain);
-	    }
+	if (exists($env{'user.priv.ca./'.$domain.'/'.$ownername.'./'}) ||
+	    exists($env{'user.priv.aa./'.$domain.'/'.$ownername.'./'}) ) {
+	    return ($ownername,$domain);
 	}
     }
     return '';