Re: Keeping POST information between request phases

2001-10-01 Thread Alin Simionoiu

I tried instance, but is not working is you want to access let's say,
POST data in a authentication handler, doing same data validation or
whatever you want to do, and also access the same POST data at response
phase.

And this is because, as it is explained in guide, POST data are
retrieved directly from the socket.So once you read that, is gone.

The only way to keep this around that I know about is to internally
transform POST in a GET.

For sure this is not the best solution, specially if you have large POST
body, because you can exceed GET maximum length.



On Mon, 2001-10-01 at 10:35, Thomas Eibner wrote:
> On Sun, Sep 30, 2001 at 03:23:51PM -0700, Alin Simionoiu wrote:
> > Apache::Request->instance($r) will not work for POST reqests.
> > At list will not do what you want.
> 
> Apache::Request->instance works very well with POST requests.
> 
> >From the documentation:
> 
>   instance
> 
>   The instance() class method allows Apache::Request to
>   be a singleton.  This means that whenever you call
>   Apache::Request->instance() within a single request
>   you always get the same Apache::Request object back.
>   This solves the problem with creating the
>   Apache::Request object twice within the same request -
>   the symptoms being that the second Apache::Request
>   object will not contain the form parameters because
>   they have already been read and parsed.
> 
>   my $apr = Apache::Request->instance($r, DISABLE_UPLOADS => 1);
> 
>   Note that "instance()" call will take the same parame-
>   ters as the above call to "new()", however the parame-
>   ters will only have an effect the first time
>   "instance()" is called within a single request. Extra
>   parameters will be ignored on subsequent calls to
>   "instance()" within the same request.
> 
> > Read this for more information:
> > 
> > http://perl.apache.org/guide/snippets.html#Reusing_Data_from_POST_request
> 
> Above instance method was made to avoid having to do workarounds like
> that in the guide.
> 
> -- 
>   Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
>   mod_pointer <http://stderr.net/mod_pointer> 
> 





Re: Keeping POST information between request phases

2001-10-01 Thread Alin Simionoiu

Apache::Request->instance($r) will not work for POST reqests.
At list will not do what you want.

Read this for more information:

http://perl.apache.org/guide/snippets.html#Reusing_Data_from_POST_request


On Sun, 2001-09-30 at 09:15, Thomas Eibner wrote:
> On Sun, Sep 30, 2001 at 05:59:08PM +0200, Issac Goldstand wrote:
> > I know this sounds like a rather newbie-ish question, but I guess I never really 
>did many inter-request-phase stuff before...  Anyway, how can I keep track of the 
>information from a POST request between different phases of Apache's handling?  For 
>example, if I have a $q=new Apache::Request($r); in, say, the Authentication, how can 
>I get the POSTed variables in, say, the Response phase?
> 
> Use the "newly" introduced instance function of Apache::Request :
> 
> my $apr = Apache::Request->instance($r);
> 
> -- 
>   Thomas Eibner  DnsZone 
>   mod_pointer  
> 





Re: Cloning the request object

2001-09-09 Thread Alin Simionoiu

I forgot to mention that I'm trying to inspect the body in a authentication
handler.
As soon as a get the body, the body is gone.


- Original Message -
From: "Steven Lembark" <[EMAIL PROTECTED]>
To: "Alin Simionoiu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, September 08, 2001 5:39 PM
Subject: Re: Cloning the request object


>
>
> -- Alin Simionoiu <[EMAIL PROTECTED]>
>
> > Hi there,
> >
> > Those anybody know if is possible to clone the apache request object?.
> > I'm trying to write a Apache module that do some basic validation
against
> > the request parameters.
> > But as soon as a touching the request is gone.
> > any other posibilities?
>
> I've never had problems with:
>
> sub handler
> {
> my $request = shift;
>
> foo $request or croak "foo doesn't like you!";
> ...
> }
>
> sub foo
> {
> my $request = shift;
> ...
> }
>
> --
> Steven Lembark   2930 W.
Palmer
> Workhorse Computing   Chicago, IL
60647
> +1 800 762
1582
>




Cloning the request object

2001-09-08 Thread Alin Simionoiu

Hi there,

Those anybody know if is possible to clone the apache request object?.
I'm trying to write a Apache module that do some basic validation against
the request parameters.
But as soon as a touching the request is gone.
any other posibilities?

thank's
alin