Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('SYSPATH') OR die('No direct access allowed.');
- class Auth_User_Model extends ORM {
- /**
- * Validates and optionally saves a new user record from an array.
- *
- * @param array values to check
- * @param boolean save the record when validation succeeds
- * @return boolean
- */
- public function validate(array & $array, $save = FALSE)
- {
- $array = Validation::factory($array)
- ->pre_filter('trim')
- ->add_rules('email', 'required', 'length[4,127]', 'valid::email', array($this, 'email_available'))
- ->add_rules('username', 'required', 'length[4,32]', 'chars[a-zA-Z0-9_.]', array($this, 'username_available'))
- ->add_rules('password', 'required', 'length[5,42]')
- ->add_rules('password_confirm', 'matches[password]');
- return parent::validate($array, $save);
- }
Add Comment
Please, Sign In to add comment