Zakładam na pole z hasłem taki filtr, validator ma zgłosić
błąd jeśli hasło jest niepoprawne.
Pole to nie służy do logowania tylko do autoryzacji podczas zmiany
hasła.

Działałoby to pewnie dobrze gdyby hasło nie było w md5. Jak to
zrobić żeby to działało z hasłem md5?

  1. $inputFilter->add($factory->createInput(array(
  2. 'name' => 'in-password',
  3. 'required' => true,
  4. 'filters' => array(
  5. array('name' => 'StripTags'),
  6. array('name' => 'StringTrim'),
  7. ),
  8. 'validators' => array(
  9. 'name' => 'StringLength',
  10. 'options' => array(
  11. 'encoding' => 'UTF-8',
  12. 'min' => 6,
  13. 'max' => 32,
  14. ),
  15. ),
  16. 'name' => 'Db\NoRecordExists',
  17. 'options' => array(
  18. 'adapter' => $this->db,
  19. 'table' => 'users',
  20. 'field' => 'password',
  21. 'exclude' => array(
  22. 'field' => 'user_id',
  23. 'value' => $this->user_id
  24. ),
  25. ),
  26. ),
  27. ),
  28. )));