Created
February 13, 2012 18:41
-
-
Save housni/1818975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//extensions/data/Model.php | |
public static function __init() { | |
static::_isBase(__CLASS__, true); | |
parent::__init(); | |
//static::all(); //doesn't work | |
#$self = static::_object(); | |
#static::config(); | |
//check to see if passwords match | |
Validator::add('passwordVerification', function($value, $rule, $options) { | |
/** | |
* If password2 does not exist, that means a form without a password2 field was submitted. | |
* If such a form was submitted, it's safe to assumed we don't need to match the passwords. | |
*/ | |
if(!isset($options['values']['password2'])) { | |
return true; | |
} | |
if (Password::check($options['values']['password2'], $options['values']['password'])) { | |
return true; | |
} | |
return false; | |
}); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment