--- loncom/auth/loncacc.pm 2005/06/19 00:41:32 1.39 +++ loncom/auth/loncacc.pm 2006/04/13 19:07:33 1.41 @@ -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.41 2006/04/13 19:07:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,12 +31,11 @@ package Apache::loncacc; use strict; use Apache::Constants qw(:common :http :methods REDIRECT); -use Apache::File; use CGI::Cookie(); use Fcntl qw(:flock); use Apache::lonlocal; use Apache::lonnet; - +use Apache::lonacc; sub constructaccess { my ($url,$ownerdomain)=@_; @@ -54,17 +53,9 @@ sub constructaccess { } 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 ''; @@ -103,7 +94,7 @@ sub handler { # -------------------------------------------------------- Load POST parameters - &Apache::loncommon::get_posted_cgi($r); + &Apache::lonacc::get_posted_cgi($r); return OK; } else {