[Html-widget] Callback Constraint with multiple values?

Ash Berlin ash at cpan.org
Mon Jun 5 23:55:51 CEST 2006


Roland Moriz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> is there a way to have a Callback Constraint and multiple fields?
>
> e.g.
>
> $w->constraint('Callback', 'username', 'password')->callback(sub {
>       my $username = shift;
>       my $password = shift;
>       my $user = $c->model('DB1::User')->find({ email => $username,
> password => $password });
>       defined($user) ? return 1 : return 0;
> })->message('Password wrong or Account not existing.');
>
>
> Thank you!
>
> - --
> Mit freundlichen Gruessen,
> with best regards,
>
> Roland Moriz
>
> - --
> http://www.perl-freelancer.com/
> http://www.roland-moriz.de/
>   
I don't think so, but even so that is not the right way to go about 
doing login - look at Catalyst::Plugin::Authentication ( 
http://search.cpan.org/dist/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm 
) for a more Catalyst way of doing that.

Ash




More information about the Html-widget mailing list