--- loncom/auth/loncacc.pm 2001/12/21 16:57:54 1.18 +++ loncom/auth/loncacc.pm 2003/02/03 18:03:52 1.25 @@ -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.18 2001/12/21 16:57:54 harris41 Exp $ +# $Id: loncacc.pm,v 1.25 2003/02/03 18:03:52 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,8 +31,8 @@ # YEAR=2001 # 01/06,01/11,6/1,9/25,9/28,11/22,12/25,12/26, # 01/06/01,05/04,05/05,05/09 Gerd Kortemeyer -# 12/21 Scott Harrison -# +# YEAR=2002 +# 1/4 Gerd Kortemeyer ### package Apache::loncacc; @@ -47,7 +47,8 @@ sub constructaccess { my ($url,$ownerdomain)=@_; 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 ''; } if (($ownername eq $ENV{'user.name'}) && ($ownerdomain eq $ENV{'user.domain'})) { return ($ownername,$ownerdomain); @@ -68,6 +69,7 @@ sub constructaccess { sub handler { my $r = shift; my $requrl=$r->uri; + $ENV{'request.editurl'}=$requrl; my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); my $lonid=$cookies{'lonID'}; my $cookie; @@ -114,7 +116,7 @@ sub handler { $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; - $ENV{"form.$name"}=$value; + &Apache::loncommon::add_to_env("form.$name",$value); } } else { my $contentsep=$1; @@ -134,7 +136,7 @@ sub handler { } else { $value=~s/\s+$//s; } - $ENV{"form.$name"}=$value; + &Apache::loncommon::add_to_env("form.$name",$value); } if ($i<$#lines) { $i++; @@ -162,6 +164,7 @@ sub handler { } } } + $ENV{'request.method'}=$ENV{'REQUEST_METHOD'}; $r->method_number(M_GET); $r->method('GET'); $r->headers_in->unset('Content-length'); @@ -187,7 +190,7 @@ Apache::lonacc - Cookie Based Access Han =head1 SYNOPSIS -Invoked (for various locations) by /etc/httpd/conf/srm.conf: +Invoked (for various locations) by /etc/httpd/conf/loncapa_apache.conf: PerlAccessHandler Apache::loncacc