From f7e8bb8fa83fb7ef2be12cad3f4627f91f09cfb2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 11 Jan 2016 21:08:37 -0500 Subject: Move user validator methods --- app/Validator/Base.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/Validator/Base.php') diff --git a/app/Validator/Base.php b/app/Validator/Base.php index 6c56e2fd..ba32a503 100644 --- a/app/Validator/Base.php +++ b/app/Validator/Base.php @@ -2,6 +2,8 @@ namespace Kanboard\Validator; +use SimpleValidator\Validators; + /** * Base Validator * @@ -33,4 +35,20 @@ class Base extends \Kanboard\Core\Base return array($result, $errors); } + + /** + * Common password validation rules + * + * @access protected + * @return array + */ + protected function commonPasswordValidationRules() + { + return array( + new Validators\Required('password', t('The password is required')), + new Validators\MinLength('password', t('The minimum length is %d characters', 6), 6), + new Validators\Required('confirmation', t('The confirmation is required')), + new Validators\Equals('password', 'confirmation', t('Passwords don\'t match')), + ); + } } -- cgit v1.2.3