diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-09 17:28:31 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-09 17:28:31 -0500 |
commit | 26e3996014936268f4acbfa214fa881af9320ddd (patch) | |
tree | 5f7fa2c1b73e4443ce75e8919383bdf775492304 /app/Validator/Base.php | |
parent | 03032c3190a27408d60e27f486a4ca472448e9dc (diff) |
Add forgot password feature
Diffstat (limited to 'app/Validator/Base.php')
-rw-r--r-- | app/Validator/Base.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Validator/Base.php b/app/Validator/Base.php new file mode 100644 index 00000000..6c56e2fd --- /dev/null +++ b/app/Validator/Base.php @@ -0,0 +1,36 @@ +<?php + +namespace Kanboard\Validator; + +/** + * Base Validator + * + * @package validator + * @author Frederic Guillot + */ +class Base extends \Kanboard\Core\Base +{ + /** + * Execute multiple validators + * + * @access public + * @param array $validators List of validators + * @param array $values Form values + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function executeValidators(array $validators, array $values) + { + $result = false; + $errors = array(); + + foreach ($validators as $method) { + list($result, $errors) = $this->$method($values); + + if (! $result) { + break; + } + } + + return array($result, $errors); + } +} |