summaryrefslogtreecommitdiff
path: root/app/Validator/Base.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-11 21:08:37 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-11 21:08:37 -0500
commitf7e8bb8fa83fb7ef2be12cad3f4627f91f09cfb2 (patch)
treea66239ab944463c66f215de6bdae5c271a6ab2b3 /app/Validator/Base.php
parentcec8491acd07520ec1c83a8747b631e2d809d96b (diff)
Move user validator methods
Diffstat (limited to 'app/Validator/Base.php')
-rw-r--r--app/Validator/Base.php18
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')),
+ );
+ }
}