--- loncom/auth/loncacc.pm 2003/05/13 00:52:46 1.28 +++ loncom/auth/loncacc.pm 2004/01/15 20:22:47 1.32 @@ -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.28 2003/05/13 00:52:46 www Exp $ +# $Id: loncacc.pm,v 1.32 2004/01/15 20:22:47 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,10 +42,11 @@ use Apache::Constants qw(:common :http : use Apache::File; use CGI::Cookie(); use Fcntl qw(:flock); +use Apache::lonlocal; sub constructaccess { my ($url,$ownerdomain)=@_; - my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)/); + my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)\//); unless (($ownername) && ($ownerdomain)) { return ''; } # We do not allow editing of previous versions of files. if ($url=~/\.(\d+)\.(\w+)$/) { return ''; } @@ -55,14 +56,12 @@ sub constructaccess { } my $capriv='user.priv.ca./'. - $ownerdomain.'/'.$ownername.'./'. - $ownerdomain.'/'.$ownername; + $ownerdomain.'/'.$ownername.'./'; foreach (keys %ENV) { if ($_ eq $capriv) { return ($ownername,$ownerdomain); } } - return ''; } @@ -83,6 +82,10 @@ sub handler { &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); +# --------------------------------------------------------- Initialize Language + + &Apache::lonlocal::get_language_handle($r); + # -------------------------------------------------------------- Resource State $ENV{'request.state'} = "construct";