diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-11 21:08:37 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-11 21:08:37 -0500 |
commit | f7e8bb8fa83fb7ef2be12cad3f4627f91f09cfb2 (patch) | |
tree | a66239ab944463c66f215de6bdae5c271a6ab2b3 /app/Validator/Base.php | |
parent | cec8491acd07520ec1c83a8747b631e2d809d96b (diff) |
Move user validator methods
Diffstat (limited to 'app/Validator/Base.php')
-rw-r--r-- | app/Validator/Base.php | 18 |
1 files changed, 18 insertions, 0 deletions
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')), + ); + } } |