<?php
namespace Moto\Application\Auth; use Moto\InputFilter\AbstractInputFilter; class ResetPasswordFilter extends AbstractInputFilter { protected $_name = 'auth.reset'; public function init() { $this->add(array( 'name' => 'token', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'Regex', 'options' => array( 'pattern' => '/^([0-9]+)-([0-9]+)-([a-f0-9]+)$/', ) ) ), )); $this->add(array( 'name' => 'password', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 6, 'max' => 100, ), ) ), )); $this->add(array( 'name' => 'confirm', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 6, 'max' => 100, ), ), array( 'name' => 'Identical', 'options' => array( 'token' => 'password' ) ), ), )); } } 