diff options
Diffstat (limited to 'app/Validator')
-rw-r--r-- | app/Validator/ActionValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/AuthValidator.php | 8 | ||||
-rw-r--r-- | app/Validator/BaseValidator.php (renamed from app/Validator/Base.php) | 5 | ||||
-rw-r--r-- | app/Validator/CategoryValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/ColumnValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/CommentValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/CurrencyValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/CustomFilterValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/ExternalLinkValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/GroupValidator.php | 8 | ||||
-rw-r--r-- | app/Validator/LinkValidator.php | 10 | ||||
-rw-r--r-- | app/Validator/PasswordResetValidator.php | 6 | ||||
-rw-r--r-- | app/Validator/ProjectValidator.php | 8 | ||||
-rw-r--r-- | app/Validator/SubtaskValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/SwimlaneValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/TaskLinkValidator.php | 8 | ||||
-rw-r--r-- | app/Validator/TaskValidator.php | 4 | ||||
-rw-r--r-- | app/Validator/UserValidator.php | 8 |
18 files changed, 51 insertions, 50 deletions
diff --git a/app/Validator/ActionValidator.php b/app/Validator/ActionValidator.php index 95ee7d21..4ce5db46 100644 --- a/app/Validator/ActionValidator.php +++ b/app/Validator/ActionValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Action Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ActionValidator extends Base +class ActionValidator extends BaseValidator { /** * Validate action creation diff --git a/app/Validator/AuthValidator.php b/app/Validator/AuthValidator.php index cd6e04d5..03ff6f22 100644 --- a/app/Validator/AuthValidator.php +++ b/app/Validator/AuthValidator.php @@ -9,10 +9,10 @@ use Gregwar\Captcha\CaptchaBuilder; /** * Authentication Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class AuthValidator extends Base +class AuthValidator extends BaseValidator { /** * Validate user login form @@ -59,7 +59,7 @@ class AuthValidator extends Base $result = true; $errors = array(); - if ($this->userLocking->isLocked($values['username'])) { + if ($this->userLockingModel->isLocked($values['username'])) { $result = false; $errors['login'] = t('Your account is locked for %d minutes', BRUTEFORCE_LOCKDOWN_DURATION); $this->logger->error('Account locked: '.$values['username']); @@ -100,7 +100,7 @@ class AuthValidator extends Base $result = true; $errors = array(); - if ($this->userLocking->hasCaptcha($values['username'])) { + if ($this->userLockingModel->hasCaptcha($values['username'])) { if (! isset($this->sessionStorage->captcha)) { $result = false; } else { diff --git a/app/Validator/Base.php b/app/Validator/BaseValidator.php index ba32a503..6088538c 100644 --- a/app/Validator/Base.php +++ b/app/Validator/BaseValidator.php @@ -2,15 +2,16 @@ namespace Kanboard\Validator; +use Kanboard\Core\Base; use SimpleValidator\Validators; /** * Base Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class Base extends \Kanboard\Core\Base +abstract class BaseValidator extends Base { /** * Execute multiple validators diff --git a/app/Validator/CategoryValidator.php b/app/Validator/CategoryValidator.php index 715aed66..fc42d2e5 100644 --- a/app/Validator/CategoryValidator.php +++ b/app/Validator/CategoryValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Category Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CategoryValidator extends Base +class CategoryValidator extends BaseValidator { /** * Validate category creation diff --git a/app/Validator/ColumnValidator.php b/app/Validator/ColumnValidator.php index f0f1659b..25aa45d0 100644 --- a/app/Validator/ColumnValidator.php +++ b/app/Validator/ColumnValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Column Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ColumnValidator extends Base +class ColumnValidator extends BaseValidator { /** * Validate column modification diff --git a/app/Validator/CommentValidator.php b/app/Validator/CommentValidator.php index 4eb54206..fc8e6da8 100644 --- a/app/Validator/CommentValidator.php +++ b/app/Validator/CommentValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Comment Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CommentValidator extends Base +class CommentValidator extends BaseValidator { /** * Validate comment creation diff --git a/app/Validator/CurrencyValidator.php b/app/Validator/CurrencyValidator.php index ee191523..4f375c54 100644 --- a/app/Validator/CurrencyValidator.php +++ b/app/Validator/CurrencyValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Currency Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CurrencyValidator extends Base +class CurrencyValidator extends BaseValidator { /** * Validate diff --git a/app/Validator/CustomFilterValidator.php b/app/Validator/CustomFilterValidator.php index 07f2a1eb..1ab9303d 100644 --- a/app/Validator/CustomFilterValidator.php +++ b/app/Validator/CustomFilterValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Custom Filter Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class CustomFilterValidator extends Base +class CustomFilterValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/ExternalLinkValidator.php b/app/Validator/ExternalLinkValidator.php index fff4133b..9c017708 100644 --- a/app/Validator/ExternalLinkValidator.php +++ b/app/Validator/ExternalLinkValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * External Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ExternalLinkValidator extends Base +class ExternalLinkValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/GroupValidator.php b/app/Validator/GroupValidator.php index 2226abd3..8b21c697 100644 --- a/app/Validator/GroupValidator.php +++ b/app/Validator/GroupValidator.php @@ -4,15 +4,15 @@ namespace Kanboard\Validator; use SimpleValidator\Validator; use SimpleValidator\Validators; -use Kanboard\Model\Group; +use Kanboard\Model\GroupModel; /** * Group Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class GroupValidator extends Base +class GroupValidator extends BaseValidator { /** * Validate creation @@ -63,7 +63,7 @@ class GroupValidator extends Base return array( new Validators\Required('name', t('The name is required')), new Validators\MaxLength('name', t('The maximum length is %d characters', 100), 100), - new Validators\Unique('name', t('The name must be unique'), $this->db->getConnection(), Group::TABLE, 'id'), + new Validators\Unique('name', t('The name must be unique'), $this->db->getConnection(), GroupModel::TABLE, 'id'), new Validators\MaxLength('external_id', t('The maximum length is %d characters', 255), 255), new Validators\Integer('id', t('This value must be an integer')), ); diff --git a/app/Validator/LinkValidator.php b/app/Validator/LinkValidator.php index 10a826da..8e1c8780 100644 --- a/app/Validator/LinkValidator.php +++ b/app/Validator/LinkValidator.php @@ -4,15 +4,15 @@ namespace Kanboard\Validator; use SimpleValidator\Validator; use SimpleValidator\Validators; -use Kanboard\Model\Link; +use Kanboard\Model\LinkModel; /** * Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class LinkValidator extends Base +class LinkValidator extends BaseValidator { /** * Validate creation @@ -25,7 +25,7 @@ class LinkValidator extends Base { $v = new Validator($values, array( new Validators\Required('label', t('Field required')), - new Validators\Unique('label', t('This label must be unique'), $this->db->getConnection(), Link::TABLE), + new Validators\Unique('label', t('This label must be unique'), $this->db->getConnection(), LinkModel::TABLE), new Validators\NotEquals('label', 'opposite_label', t('The labels must be different')), )); @@ -48,7 +48,7 @@ class LinkValidator extends Base new Validators\Required('id', t('Field required')), new Validators\Required('opposite_id', t('Field required')), new Validators\Required('label', t('Field required')), - new Validators\Unique('label', t('This label must be unique'), $this->db->getConnection(), Link::TABLE), + new Validators\Unique('label', t('This label must be unique'), $this->db->getConnection(), LinkModel::TABLE), )); return array( diff --git a/app/Validator/PasswordResetValidator.php b/app/Validator/PasswordResetValidator.php index baf2d8d7..e44e5206 100644 --- a/app/Validator/PasswordResetValidator.php +++ b/app/Validator/PasswordResetValidator.php @@ -9,10 +9,10 @@ use Gregwar\Captcha\CaptchaBuilder; /** * Password Reset Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class PasswordResetValidator extends Base +class PasswordResetValidator extends BaseValidator { /** * Validate creation @@ -87,6 +87,6 @@ class PasswordResetValidator extends Base } } - return array($result, $errors);; + return array($result, $errors); } } diff --git a/app/Validator/ProjectValidator.php b/app/Validator/ProjectValidator.php index 1c6c90f8..9ef59111 100644 --- a/app/Validator/ProjectValidator.php +++ b/app/Validator/ProjectValidator.php @@ -4,15 +4,15 @@ namespace Kanboard\Validator; use SimpleValidator\Validator; use SimpleValidator\Validators; -use Kanboard\Model\Project; +use Kanboard\Model\ProjectModel; /** * Project Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class ProjectValidator extends Base +class ProjectValidator extends BaseValidator { /** * Common validation rules @@ -34,7 +34,7 @@ class ProjectValidator extends Base new Validators\MaxLength('start_date', t('The maximum length is %d characters', 10), 10), new Validators\MaxLength('end_date', t('The maximum length is %d characters', 10), 10), new Validators\AlphaNumeric('identifier', t('This value must be alphanumeric')) , - new Validators\Unique('identifier', t('The identifier must be unique'), $this->db->getConnection(), Project::TABLE), + new Validators\Unique('identifier', t('The identifier must be unique'), $this->db->getConnection(), ProjectModel::TABLE), ); } diff --git a/app/Validator/SubtaskValidator.php b/app/Validator/SubtaskValidator.php index 1989b7f4..b80de41d 100644 --- a/app/Validator/SubtaskValidator.php +++ b/app/Validator/SubtaskValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Subtask Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class SubtaskValidator extends Base +class SubtaskValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/SwimlaneValidator.php b/app/Validator/SwimlaneValidator.php index 4cc780f9..16f8bfba 100644 --- a/app/Validator/SwimlaneValidator.php +++ b/app/Validator/SwimlaneValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Swimlane Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class SwimlaneValidator extends Base +class SwimlaneValidator extends BaseValidator { /** * Validate creation diff --git a/app/Validator/TaskLinkValidator.php b/app/Validator/TaskLinkValidator.php index c88c2b16..6da257bf 100644 --- a/app/Validator/TaskLinkValidator.php +++ b/app/Validator/TaskLinkValidator.php @@ -4,15 +4,15 @@ namespace Kanboard\Validator; use SimpleValidator\Validator; use SimpleValidator\Validators; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Task Link Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class TaskLinkValidator extends Base +class TaskLinkValidator extends BaseValidator { /** * Common validation rules @@ -27,7 +27,7 @@ class TaskLinkValidator extends Base new Validators\Required('opposite_task_id', t('Field required')), new Validators\Required('link_id', t('Field required')), new Validators\NotEquals('opposite_task_id', 'task_id', t('A task cannot be linked to itself')), - new Validators\Exists('opposite_task_id', t('This linked task id doesn\'t exists'), $this->db->getConnection(), Task::TABLE, 'id') + new Validators\Exists('opposite_task_id', t('This linked task id doesn\'t exists'), $this->db->getConnection(), TaskModel::TABLE, 'id') ); } diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 55ea8fdd..7c39ff51 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -8,10 +8,10 @@ use SimpleValidator\Validators; /** * Task Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class TaskValidator extends Base +class TaskValidator extends BaseValidator { /** * Common validation rules diff --git a/app/Validator/UserValidator.php b/app/Validator/UserValidator.php index e5953f30..9911de50 100644 --- a/app/Validator/UserValidator.php +++ b/app/Validator/UserValidator.php @@ -4,15 +4,15 @@ namespace Kanboard\Validator; use SimpleValidator\Validator; use SimpleValidator\Validators; -use Kanboard\Model\User; +use Kanboard\Model\UserModel; /** * User Validator * - * @package validator + * @package Kanboard\Validator * @author Frederic Guillot */ -class UserValidator extends Base +class UserValidator extends BaseValidator { /** * Common validation rules @@ -25,7 +25,7 @@ class UserValidator extends Base return array( new Validators\MaxLength('role', t('The maximum length is %d characters', 25), 25), new Validators\MaxLength('username', t('The maximum length is %d characters', 50), 50), - new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), User::TABLE, 'id'), + new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), UserModel::TABLE, 'id'), new Validators\Email('email', t('Email address invalid')), new Validators\Integer('is_ldap_user', t('This value must be an integer')), ); |