Mailing List Archive

Engine/CGI and query+post params
Is there a way to get Catalyst::Engine::CGI to include both ?query and POST
parameters in $c->req->params?

When I run my app under mod_perl, and have a <form action="foo?bar=baz"
method="POST">, then I can get both $c->req->params->{bar} plus any posted
form values.

However, when I run ./scripts/server.pl, I do not get the query vars, only
the posted vars.

This is probably a limitation of CGI::Simple and I am out of luck, but I
thought I would throw it out there and see if anyone has any ideas.

Thanks,
Michael.
Engine/CGI and query+post params [ In reply to ]
Am 12.04.2005 um 22:34 schrieb Michael Reece:

> Is there a way to get Catalyst::Engine::CGI to include both ?query and
> POST
> parameters in $c->req->params?
>
> When I run my app under mod_perl, and have a <form action="foo?bar=baz"
> method="POST">, then I can get both $c->req->params->{bar} plus any
> posted
> form values.
>
> However, when I run ./scripts/server.pl, I do not get the query vars,
> only
> the posted vars.
>
> This is probably a limitation of CGI::Simple and I am out of luck, but
> I
> thought I would throw it out there and see if anyone has any ideas.

It would be helpful to know which version you're talking about!
Since Catalyst5 got a whole new set of engines. (CGI::Simple for
example is completely gone)...

--
sebastian
Engine/CGI and query+post params [ In reply to ]
Sorry, 4.34 aka the one on CPAN.

When do you expect Cat5 might be stable enough to release to CPAN?

And, speaking of Cat5, maybe you can tell me if this has changed in the new
version.

In Cat4, C::Plugin::Authentication::CDBI sets $c->request->{user} to the
username, rather than the user object ( from $user_class->search(..) ). I
found that to be ultimately useless, and changed it put the user object in
there instead, so my templates can make use of the user's preferences and
other bits from their db record. Anything in the Authentication, such as
that, changing in Cat5?

thanks

On 4/12/05 11:56 AM, "Sebastian Riedel" <sri@oook.de> wrote:

>
> Am 12.04.2005 um 22:34 schrieb Michael Reece:
>
>> Is there a way to get Catalyst::Engine::CGI to include both ?query and
>> POST
>> parameters in $c->req->params?
>>
>> When I run my app under mod_perl, and have a <form action="foo?bar=baz"
>> method="POST">, then I can get both $c->req->params->{bar} plus any
>> posted
>> form values.
>>
>> However, when I run ./scripts/server.pl, I do not get the query vars,
>> only
>> the posted vars.
>>
>> This is probably a limitation of CGI::Simple and I am out of luck, but
>> I
>> thought I would throw it out there and see if anyone has any ideas.
>
> It would be helpful to know which version you're talking about!
> Since Catalyst5 got a whole new set of engines. (CGI::Simple for
> example is completely gone)...
>
> --
> sebastian
Engine/CGI and query+post params [ In reply to ]
Am 12.04.2005 um 23:15 schrieb Michael Reece:

> Sorry, 4.34 aka the one on CPAN.
>
> When do you expect Cat5 might be stable enough to release to CPAN?

Actually all 300 tests pass...so it should be in a few days...
I promised to give Christian some more time to test. (and it already
payed off)

>
> And, speaking of Cat5, maybe you can tell me if this has changed in
> the new
> version.

I'm not 100% sure, but i would bet it's fixed.

>
> In Cat4, C::Plugin::Authentication::CDBI sets $c->request->{user} to
> the
> username, rather than the user object ( from $user_class->search(..)
> ). I
> found that to be ultimately useless, and changed it put the user
> object in
> there instead, so my templates can make use of the user's preferences
> and
> other bits from their db record. Anything in the Authentication, such
> as
> that, changing in Cat5?

Don't take the the plugins i write as the one way to go, Catalyst is a
component system, so they are mostly just examples, showing whats
possible.
Everybody is not just free to subclass and extend them, everybody is
encouraged to do so! ;)

--
sebastian
Engine/CGI and query+post params [ In reply to ]
Sebastian Riedel wrote:
> Don't take the the plugins i write as the one way to go, Catalyst is a
> component system, so they are mostly just examples, showing whats possible.
> Everybody is not just free to subclass and extend them, everybody is
> encouraged to do so! ;)

I agree that one of the problems with Maypole was that many users
expected the supplied templates and classes to automagically do
everything they wanted, and that is just not feasible.

However if there is something that many Catalyst users will want
to do in a very similar manner (eg. authentication with roles), it is
advantageous for that effort to be concentrated into a re-usable,
downloadable module. And if done properly, everybody wins. Many
people just want to get the job done.

I would hate to see Catalyst end up like "a neat operating system with
no tools or apps". But I don't necessarily expect the Catalyst authors
to be responsible for these modules - but in the early stages perhaps
they need to, especially at the rate the Catalyst changes.

--Torsten Seemann
Engine/CGI and query+post params [ In reply to ]
On Tue, Apr 12, 2005 at 01:15:33PM -0800, Michael Reece wrote:
> In Cat4, C::Plugin::Authentication::CDBI sets $c->request->{user} to the
> username, rather than the user object ( from $user_class->search(..) ). I
> found that to be ultimately useless, and changed it put the user object in
> there instead, so my templates can make use of the user's preferences and
> other bits from their db record. Anything in the Authentication, such as
> that, changing in Cat5?

Yeah, as part of my journey into the realms of Cat5 I've realised that
I'd like to return a blob of user info, rather than just the username.

What's the 'proper' way of doing this?

At the moment I have a local module Catalyst::Plugin::Login that just
use base's C::Plugin::Authentication::CDBI, and I've copied the
session_login() function from CPA::CDBI and doctored the

$c->stash->{'user'} = $user;

statement to be set to the result of a App::M::CDBI::Table->search
query.

It seems to be doing what I intend, but my instincts are telling me that
this is wrong.

Any comments either way?

Chisel
--
Chisel Wright
e: chisel@herlpacker.co.uk
w: http://www.herlpacker.co.uk/

"This is not the greatest sig in the world, no, this is just a tribute."