Welcome Guest, Not a member yet? Register   Sign In
Validation
#7

[eluser]xwero[/eluser]
I don't know if it is going to work but you could extend the validation library with a user_exists rule
Code:
MY_Validation extends CI_Validation
{
    function user_exists($user,$password)
    {
       // database code
       return (exists)?TRUE:FALSE;
    }
}
in the controller you would have to do something like
Code:
$rules['username'] = "user_exists[password]";
Then you have to add the user_exists message to the validation language file.
Again i don't know if it works but if it does it seems to be a better way to extend the rules than using callbacks. The only drawback is the compatibility with future versions of the CI validation class.


Messages In This Thread
Validation - by El Forum - 10-22-2007, 03:49 AM
Validation - by El Forum - 10-22-2007, 05:17 AM
Validation - by El Forum - 10-22-2007, 07:02 AM
Validation - by El Forum - 10-22-2007, 03:02 PM
Validation - by El Forum - 10-22-2007, 03:40 PM
Validation - by El Forum - 10-22-2007, 05:27 PM
Validation - by El Forum - 10-22-2007, 06:15 PM
Validation - by El Forum - 10-22-2007, 07:16 PM
Validation - by El Forum - 10-23-2007, 07:11 AM
Validation - by El Forum - 10-23-2007, 05:47 PM
Validation - by El Forum - 10-24-2007, 12:47 AM
Validation - by El Forum - 10-24-2007, 01:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB