Hi all,

I made my own validator, which works perfectly. There is only one
problem: I cannot make more error messages then "required" and
"invalid".

See my code below, I want to check a signin procedure. I want two
error messages: one if the e-mailaddress does not exist (user does not
exist) and one if the e-mailaddress / password combination is false.

<?php

class kmValidatorSignin{

        public static function execute($oValidator, $sValue,
$aArguments){

                $oCriteria = new Criteria();
                $oCriteria->add(EmployeePeer::EMAIL_ADDRESS, $sValue,
Criteria::EQUAL);
                $oEmployee = EmployeePeer::doSelectOne($oCriteria);

                if(!$oEmployee || !$oEmployee->getActive()){
                        throw new sfValidatorError($oValidator,
'unknown');
                }
                elseif(sha1($oEmployee->getSalt() . $aArguments
['password']) !=
$oEmployee->getPassword()){
                        throw new sfValidatorError($oValidator,
'invalid');
                }
                else return $oEmployee;

        }

}

But I get the following Symfony error message:

500 | Internal Server Error | InvalidArgumentException
sfValidatorCallback does not support the following error codes:
'unknown'.

I know it is possible, Symfony uses this feature itself in, for
example, the sfValidatorString. There are beside the "required" and
"invalid" error codes also the "min_length" and "max_length" error
codes.

How can I make my error codes work?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to