summaryrefslogtreecommitdiff
path: root/app/Validator/Base.php
diff options
context:
space:
mode:
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')),
+ );
+ }
}