--- loncom/auth/loncacc.pm 2000/01/06 15:35:58 1.4 +++ loncom/auth/loncacc.pm 2000/07/01 17:57:01 1.7 @@ -2,12 +2,13 @@ # Cookie Based Access Handler for Construction Area # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer) # 6/15,16/11,22/11, -# 01/06 Gerd Kortemeyer +# 01/06,01/11,6/1 Gerd Kortemeyer package Apache::loncacc; use strict; use Apache::Constants qw(:common :http); +use Apache::File; use CGI::Cookie(); sub handler { @@ -46,15 +47,25 @@ sub handler { $r->subprocess_env("user.environment" => "$lonidsdir/$handle.id", "request.state" => "construct", "request.filename" => $r->filename); + my $buffer; + $r->read($buffer,$r->header_in('Content-length')); + my @pairs=split(/&/,$buffer); + my $pair; my $name; my $value; + foreach $pair (@pairs) { + ($name,$value) = split(/=/,$pair); + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; + $r->subprocess_env("form.$name" => $value); + } return OK; } else { $r->log_reason("Cookie $handle not valid", $r->filename) }; } - $cookie=CGI::Cookie->new(-name => 'lonURL', - -value => $requrl, - -path => '/'); - $r->err_headers_out->add('Set-Cookie' => $cookie); + +# ----------------------------------------------- Store where they wanted to go + + $ENV{'request.firsturl'}=$requrl; return FORBIDDEN; }