Rename all models

This commit is contained in:
Frederic Guillot
2016-05-28 19:48:22 -04:00
parent 936376ffe7
commit 14713b0ec7
411 changed files with 4145 additions and 4156 deletions

View File

@@ -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 {

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Validator;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Model\Group;
use Kanboard\Model\GroupModel;
/**
* Group Validator
@@ -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')),
);

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Validator;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Model\Link;
use Kanboard\Model\LinkModel;
/**
* Link Validator
@@ -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(

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Validator;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Model\Project;
use Kanboard\Model\ProjectModel;
/**
* Project Validator
@@ -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),
);
}

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Validator;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Model\Task;
use Kanboard\Model\TaskModel;
/**
* Task Link Validator
@@ -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')
);
}

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Validator;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Model\User;
use Kanboard\Model\UserModel;
/**
* User Validator
@@ -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')),
);