Re: [Catalyst] Which Form Validation Libs?

2010-11-29 Thread Darren Duncan

Eric Berg wrote:
I see that there are a number of form validation libraries that purport 
to work with Catalyst.  I've been using CGI::Formbuilder for years and 
have been relatively happy with it.


I need something for my new Catalyst app.  I have already created my 
forms in my TT templates, but I need validation for most of the regular 
stuff, including zip codes, states, credit card info, etc.


You guys got any  recommendations?

Thanks.

Eric


Its not form specific, but currently I like using MooseX::Types and 
MooseX::Types::Structured for validation.


You can use these to declare validators in a declarational fashion for each data 
type you have, or use pre-defined ones for some common cases.  For each type 
Foo, it provides an is_Foo function you can test inputs with.


With MooseX::Types::Structured in particular and its "Dict" type constructors, 
you can define a type to represent the form as a whole, so it will check you 
have all the right fields and their contents; that said, while using a "Dict" 
for the whole form will tell you if any field was done incorrectly, it alone 
won't say which field, so whether you might want to use it depends on how 
specific you want input error messages to be.


-- Darren Duncan

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Which Form Validation Libs?

2010-11-29 Thread Octavian Rasnita
HTML::FormFu and also:
Catalyst::Controller::HTML::FormFu
HTML::FormFu::Model::DBIC

Octavian

- Original Message - 
From: "Eric Berg" 
To: 
Sent: Tuesday, November 30, 2010 5:34 AM
Subject: [Catalyst] Which Form Validation Libs?


>I see that there are a number of form validation libraries that purport 
> to work with Catalyst.  I've been using CGI::Formbuilder for years and 
> have been relatively happy with it.
> 
> I need something for my new Catalyst app.  I have already created my 
> forms in my TT templates, but I need validation for most of the regular 
> stuff, including zip codes, states, credit card info, etc.
> 
> You guys got any  recommendations?
> 
> Thanks.
> 
> Eric
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Which Form Validation Libs?

2010-11-29 Thread Eric Berg
I see that there are a number of form validation libraries that purport 
to work with Catalyst.  I've been using CGI::Formbuilder for years and 
have been relatively happy with it.


I need something for my new Catalyst app.  I have already created my 
forms in my TT templates, but I need validation for most of the regular 
stuff, including zip codes, states, credit card info, etc.


You guys got any  recommendations?

Thanks.

Eric

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Overriding Catalyst::View::TT WRAPPER

2010-11-29 Thread Hernan Lopes
I personally think that [% IF no_wrapper %] etc is not clean enough so
i would create a new view and call it View::NoWrapper
then you can set
$c->stash(
current_view => 'NoWrapper',
template => 'src/mypage.html',
);

and then, you will need to set a wrapper.tt.
But you can choose to leave it with [% content %] only, or add some html
headers.. or whatever you need.

--Hernan

On Mon, Nov 29, 2010 at 11:27 PM, Sam Kaufman wrote:

> I've found the easiest way is to have some logic in your wrapper:
> something like this:
> [%
>  IF no_wrapper;
>  content;
>  ELSE;
>  content WRAPPER site/html + site/layout;
> END;
> %]
> so $c->stash(no_wrapper => 1) and it won't be wrapped.
> -Sam
>
> On Mon, Nov 29, 2010 at 8:16 PM, Mesdaq, Ali  wrote:
> > Hey Everyone,
> >
> > Got a question about how I can override my application's TT wrapper. The
> closest thing I found was
> http://search.cpan.org/~abraxxa/Catalyst-View-TT-0.36/lib/Catalyst/View/TT.pm#CONFIGURATION.
>  But what I am trying to do is basically have the wrapper turned off for a
> specific public method where I will create a new TT file that I want used
> without it being wrapped.
> >
> > Thanks,
> > ALI MESDAQ
> > Sr. Security Researcher
> >
> > WEBSENSE, INC.
> > ph: +1.858.320.9466
> > fax: +1.858.784.4466
> > www.websense.com
> >
> > Websense TRITON™
> > For Essential Information Protection™
> > Web Security | Data Security | Email Security
> >
> >
> >
> >
> >  Protected by Websense Hosted Email Security -- www.websense.com
> >
> > ___
> > List: Catalyst@lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
> >
> >
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Overriding Catalyst::View::TT WRAPPER

2010-11-29 Thread Sam Kaufman
I've found the easiest way is to have some logic in your wrapper:
something like this:
[%
 IF no_wrapper;
 content;
 ELSE;
 content WRAPPER site/html + site/layout;
END;
%]
so $c->stash(no_wrapper => 1) and it won't be wrapped.
-Sam

On Mon, Nov 29, 2010 at 8:16 PM, Mesdaq, Ali  wrote:
> Hey Everyone,
>
> Got a question about how I can override my application's TT wrapper. The 
> closest thing I found was 
> http://search.cpan.org/~abraxxa/Catalyst-View-TT-0.36/lib/Catalyst/View/TT.pm#CONFIGURATION
>  . But what I am trying to do is basically have the wrapper turned off for a 
> specific public method where I will create a new TT file that I want used 
> without it being wrapped.
>
> Thanks,
> ALI MESDAQ
> Sr. Security Researcher
>
> WEBSENSE, INC.
> ph: +1.858.320.9466
> fax: +1.858.784.4466
> www.websense.com
>
> Websense TRITON™
> For Essential Information Protection™
> Web Security | Data Security | Email Security
>
>
>
>
>  Protected by Websense Hosted Email Security -- www.websense.com
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Overriding Catalyst::View::TT WRAPPER

2010-11-29 Thread Mesdaq, Ali
Hey Everyone,

Got a question about how I can override my application's TT wrapper. The 
closest thing I found was 
http://search.cpan.org/~abraxxa/Catalyst-View-TT-0.36/lib/Catalyst/View/TT.pm#CONFIGURATION
 . But what I am trying to do is basically have the wrapper turned off for a 
specific public method where I will create a new TT file that I want used 
without it being wrapped.

Thanks,
ALI MESDAQ
Sr. Security Researcher

WEBSENSE, INC.
ph: +1.858.320.9466
fax: +1.858.784.4466
www.websense.com

Websense TRITON™
For Essential Information Protection™
Web Security | Data Security | Email Security




 Protected by Websense Hosted Email Security -- www.websense.com 
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: superuser "switch-user" session function?

2010-11-29 Thread Denny
On Mon, 2010-11-29 at 17:37 -0600, will trillich wrote:
> Aha! It looks like a sneaky, evil, wrong, mean, horrid way to
> switch-user in the middle of a session is to
> 
> $c->session->{__user}{id} = $new_id_here; # since "id" = PK
> 
> But that's undoubtedly bad form of the worst kind.
> 
> What's the canonical non-sneaky above-board friendly golden way to do
> this?

t0m wrote something on the list a while back about putting your user
details into the stash manually rather than using $c->user directly.
One of the reasons he gave was that then, if you want to override the
(perceived) user session, you can override $c->stash->{ user } instead
of having to mess with $c->user itself.

Although presumably it would make sense to hinge the admin-only
functions (such as 'switch user') off of $c->user - so that you can
still switch back when you're done  :)

Regards,
Denny



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: superuser "switch-user" session function?

2010-11-29 Thread will trillich
Aha! It looks like a sneaky, evil, wrong, mean, horrid way to switch-user in
the middle of a session is to

$c->session->{__user}{id} = $new_id_here; # since "id" = PK

But that's undoubtedly bad form of the worst kind.

What's the canonical non-sneaky above-board friendly golden way to do this?



On Thu, Jul 8, 2010 at 12:27 PM, w...@serensoft.com wrote:

> Hmm: Become-user?
>
> Is there a clean way to provide a means for sys-admins to "become user" to
> track down issues? It's much easier to diagnose when seeing what the user's
> seeing directly, when we look at it through our own eyes -- as opposed to
> relying on vague user-style descriptions ("unrecognized date format" vs
> "doesn't work").
>
> use Catalyst qw/
> ConfigLoader
> Static::Simple
> Session
> Session::Store::DBIC
> Session::State::Cookie
> Authentication
> Authentication::Credential::Password
> Authorization::Roles
> Authorization::ACL
> /;
>
>
>
> --
> will trillich
> "I think it would be worse to expect nothing than to be disappointed." --
> Anne (with an 'e') Shirley
>



-- 
-- 
will trillich -- http://faq.serensoft.com/
"The truth is that many people set rules to keep
from making decisions." -- Mike Krzyzewski
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Converting a GET request to a POST request

2010-11-29 Thread Ronald J Kimball
On Fri, Nov 26, 2010 at 3:02 PM, Aristotle Pagaltzis  wrote:
> * Ronald J Kimball  [2010-11-23 18:00]:
>> REST principles dictate that I use POST, not GET, for these
>> requests. The same-origin policy forces me to use JSONP, which
>> can only make GET requests, not POST. What's the solution?
>
> “You can’t get there from here”: you can’t use Javascript to make
> unsafe requests outside the origin.
>
> Step back. What are you actually trying to do?
>
> I could imagine that eg. an OAuth-based solution could work
> (wherein the user hands other sites an auth token from you, and
> the sites use that token to make requests to your site on their
> users’ behalf). Or maybe it’s too complicated or overkill for
> you – that depends on your aim and constraints.
>
> So tell us about them.

This is for a widget that will be hosted on third party websites.  The
widget will allow users of those sites to interact with our content.
The widget will be written in JavaScript and HTML.  The widget will
retrieve content and submit user interactions using Ajax and JSONP
(supposedly via a REST API :).  Users will not be required to log in
to interact with the content in the widget.

Thank you for your feedback.  Some of this is new territory for me, so
being steered away from doing things the wrong way is very helpful.

Ronald

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/