Guest User

Untitled

a guest
Oct 17th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. var $validate = array(
  2.  
  3. 'username' => array(
  4. 'alpha' => array('rule' => 'alphanumeric',
  5. 'required' => true,
  6. 'message' => 'Avec un Username c\'est mieux ! '),
  7. 'isUnique' => array
  8. (
  9. 'rule' => 'isUnique',
  10. 'message' => 'Cette pseudo existe déjà.'
  11. )
  12.  
  13. ),
  14.  
  15. 'mail' => array(
  16. 'rule' =>'email',
  17. 'message'=>'Un Email?!'
  18. ),
  19.  
  20. 'password' => array('rule' => array('confirmPassword', 'password'),
  21. 'message' => 'Password/Confirmation doesn\'t Match'),
  22. 'password_confirm' => array('rule' => 'alphanumeric',
  23. 'required' => true,
  24. 'message' => 'Une confirmation du password !?'),
  25. );
  26. function confirmPassword($data) {
  27. $valid = false;
  28. if ($data['password'] == Security::hash(Configure::read('Security.salt') . $this->data['User']['password_confirm'])) {
  29. $valid = true;
  30. }
  31. return $valid;
  32. }
Add Comment
Please, Sign In to add comment