For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > Re: [PEAR] Auth? Can I generate customized error messages based on the type of login









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Auth? Can I generate customized error messages based on the type of login
Mark

2004-06-24, 3:55 pm

I don't think you can do this, because if you examine the PEAR::DB code,
it's just making a single insertion into the database, which returns the
error. If you wanted to know whether it was password or username you
would have to select each of those separately from the database (and
then do an insertion), making for three database accesses. I you want
to do this, you need to code it yourself and bypass Auth for that. But
it's
not a good idea from a security standpoint anyway, since it would allow
people to guess usernames.

On Jun 24, 2004, at 10:36 PM, bclem@imaginative-enterprises.com wrote:

> Hi All,
>
> Is it at all possible to return the exact type of login failure from
> the auth
> class rather than just the constant value of -3? If so, how would I do
> it?
>
> I have a login form that get's submitted, I'd like to return a custom
> error
> message based on the type of login failure, be it username not
> registered,
> password incorrect, etc etc.
>
> Thanks,
> Brent
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com