summaryrefslogtreecommitdiff
path: root/app/Subscriber
diff options
context:
space:
mode:
Diffstat (limited to 'app/Subscriber')
-rw-r--r--app/Subscriber/AuthSubscriber.php16
-rw-r--r--app/Subscriber/BootstrapSubscriber.php6
-rw-r--r--app/Subscriber/LdapUserPhotoSubscriber.php2
-rw-r--r--app/Subscriber/NotificationSubscriber.php38
-rw-r--r--app/Subscriber/ProjectDailySummarySubscriber.php12
-rw-r--r--app/Subscriber/ProjectModificationDateSubscriber.php20
-rw-r--r--app/Subscriber/RecurringTaskSubscriber.php20
-rw-r--r--app/Subscriber/SubtaskTimeTrackingSubscriber.php20
-rw-r--r--app/Subscriber/TransitionSubscriber.php6
9 files changed, 70 insertions, 70 deletions
diff --git a/app/Subscriber/AuthSubscriber.php b/app/Subscriber/AuthSubscriber.php
index dfb95a00..0097c407 100644
--- a/app/Subscriber/AuthSubscriber.php
+++ b/app/Subscriber/AuthSubscriber.php
@@ -45,9 +45,9 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
$userAgent = $this->request->getUserAgent();
$ipAddress = $this->request->getIpAddress();
- $this->userLocking->resetFailedLogin($this->userSession->getUsername());
+ $this->userLockingModel->resetFailedLogin($this->userSession->getUsername());
- $this->lastLogin->create(
+ $this->lastLoginModel->create(
$event->getAuthType(),
$this->userSession->getId(),
$ipAddress,
@@ -59,7 +59,7 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
}
if (isset($this->sessionStorage->hasRememberMe) && $this->sessionStorage->hasRememberMe) {
- $session = $this->rememberMeSession->create($this->userSession->getId(), $ipAddress, $userAgent);
+ $session = $this->rememberMeSessionModel->create($this->userSession->getId(), $ipAddress, $userAgent);
$this->rememberMeCookie->write($session['token'], $session['sequence'], $session['expiration']);
}
}
@@ -75,10 +75,10 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
$credentials = $this->rememberMeCookie->read();
if ($credentials !== false) {
- $session = $this->rememberMeSession->find($credentials['token'], $credentials['sequence']);
+ $session = $this->rememberMeSessionModel->find($credentials['token'], $credentials['sequence']);
if (! empty($session)) {
- $this->rememberMeSession->remove($session['id']);
+ $this->rememberMeSessionModel->remove($session['id']);
}
$this->rememberMeCookie->remove();
@@ -97,10 +97,10 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
$username = $event->getUsername();
if (! empty($username)) {
- $this->userLocking->incrementFailedLogin($username);
+ $this->userLockingModel->incrementFailedLogin($username);
- if ($this->userLocking->getFailedLogin($username) > BRUTEFORCE_LOCKDOWN) {
- $this->userLocking->lock($username, BRUTEFORCE_LOCKDOWN_DURATION);
+ if ($this->userLockingModel->getFailedLogin($username) > BRUTEFORCE_LOCKDOWN) {
+ $this->userLockingModel->lock($username, BRUTEFORCE_LOCKDOWN_DURATION);
}
}
}
diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php
index e60840f1..7d12e9ae 100644
--- a/app/Subscriber/BootstrapSubscriber.php
+++ b/app/Subscriber/BootstrapSubscriber.php
@@ -16,12 +16,12 @@ class BootstrapSubscriber extends BaseSubscriber implements EventSubscriberInter
public function execute()
{
$this->logger->debug('Subscriber executed: '.__METHOD__);
- $this->language->loadCurrentLanguage();
- $this->timezone->setCurrentTimezone();
+ $this->languageModel->loadCurrentLanguage();
+ $this->timezoneModel->setCurrentTimezone();
$this->actionManager->attachEvents();
if ($this->userSession->isLogged()) {
- $this->sessionStorage->hasSubtaskInProgress = $this->subtask->hasSubtaskInProgress($this->userSession->getId());
+ $this->sessionStorage->hasSubtaskInProgress = $this->subtaskModel->hasSubtaskInProgress($this->userSession->getId());
}
}
diff --git a/app/Subscriber/LdapUserPhotoSubscriber.php b/app/Subscriber/LdapUserPhotoSubscriber.php
index 3cf46077..93672cd1 100644
--- a/app/Subscriber/LdapUserPhotoSubscriber.php
+++ b/app/Subscriber/LdapUserPhotoSubscriber.php
@@ -42,7 +42,7 @@ class LdapUserPhotoSubscriber extends BaseSubscriber implements EventSubscriberI
if (empty($profile['avatar_path']) && ! empty($photo)) {
$this->logger->info('Saving user photo from LDAP profile');
- $this->avatarFile->uploadImageContent($profile['id'], $photo);
+ $this->avatarFileModel->uploadImageContent($profile['id'], $photo);
}
}
}
diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php
index 2a1fe6c7..db11e585 100644
--- a/app/Subscriber/NotificationSubscriber.php
+++ b/app/Subscriber/NotificationSubscriber.php
@@ -4,10 +4,10 @@ namespace Kanboard\Subscriber;
use Kanboard\Event\GenericEvent;
use Kanboard\Job\NotificationJob;
-use Kanboard\Model\Task;
-use Kanboard\Model\Comment;
-use Kanboard\Model\Subtask;
-use Kanboard\Model\TaskFile;
+use Kanboard\Model\TaskModel;
+use Kanboard\Model\CommentModel;
+use Kanboard\Model\SubtaskModel;
+use Kanboard\Model\TaskFileModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class NotificationSubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -15,21 +15,21 @@ class NotificationSubscriber extends BaseSubscriber implements EventSubscriberIn
public static function getSubscribedEvents()
{
return array(
- Task::EVENT_USER_MENTION => 'handleEvent',
- Task::EVENT_CREATE => 'handleEvent',
- Task::EVENT_UPDATE => 'handleEvent',
- Task::EVENT_CLOSE => 'handleEvent',
- Task::EVENT_OPEN => 'handleEvent',
- Task::EVENT_MOVE_COLUMN => 'handleEvent',
- Task::EVENT_MOVE_POSITION => 'handleEvent',
- Task::EVENT_MOVE_SWIMLANE => 'handleEvent',
- Task::EVENT_ASSIGNEE_CHANGE => 'handleEvent',
- Subtask::EVENT_CREATE => 'handleEvent',
- Subtask::EVENT_UPDATE => 'handleEvent',
- Comment::EVENT_CREATE => 'handleEvent',
- Comment::EVENT_UPDATE => 'handleEvent',
- Comment::EVENT_USER_MENTION => 'handleEvent',
- TaskFile::EVENT_CREATE => 'handleEvent',
+ TaskModel::EVENT_USER_MENTION => 'handleEvent',
+ TaskModel::EVENT_CREATE => 'handleEvent',
+ TaskModel::EVENT_UPDATE => 'handleEvent',
+ TaskModel::EVENT_CLOSE => 'handleEvent',
+ TaskModel::EVENT_OPEN => 'handleEvent',
+ TaskModel::EVENT_MOVE_COLUMN => 'handleEvent',
+ TaskModel::EVENT_MOVE_POSITION => 'handleEvent',
+ TaskModel::EVENT_MOVE_SWIMLANE => 'handleEvent',
+ TaskModel::EVENT_ASSIGNEE_CHANGE => 'handleEvent',
+ SubtaskModel::EVENT_CREATE => 'handleEvent',
+ SubtaskModel::EVENT_UPDATE => 'handleEvent',
+ CommentModel::EVENT_CREATE => 'handleEvent',
+ CommentModel::EVENT_UPDATE => 'handleEvent',
+ CommentModel::EVENT_USER_MENTION => 'handleEvent',
+ TaskFileModel::EVENT_CREATE => 'handleEvent',
);
}
diff --git a/app/Subscriber/ProjectDailySummarySubscriber.php b/app/Subscriber/ProjectDailySummarySubscriber.php
index 982240c1..6971a121 100644
--- a/app/Subscriber/ProjectDailySummarySubscriber.php
+++ b/app/Subscriber/ProjectDailySummarySubscriber.php
@@ -4,7 +4,7 @@ namespace Kanboard\Subscriber;
use Kanboard\Event\TaskEvent;
use Kanboard\Job\ProjectMetricJob;
-use Kanboard\Model\Task;
+use Kanboard\Model\TaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ProjectDailySummarySubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -12,11 +12,11 @@ class ProjectDailySummarySubscriber extends BaseSubscriber implements EventSubsc
public static function getSubscribedEvents()
{
return array(
- Task::EVENT_CREATE_UPDATE => 'execute',
- Task::EVENT_CLOSE => 'execute',
- Task::EVENT_OPEN => 'execute',
- Task::EVENT_MOVE_COLUMN => 'execute',
- Task::EVENT_MOVE_SWIMLANE => 'execute',
+ TaskModel::EVENT_CREATE_UPDATE => 'execute',
+ TaskModel::EVENT_CLOSE => 'execute',
+ TaskModel::EVENT_OPEN => 'execute',
+ TaskModel::EVENT_MOVE_COLUMN => 'execute',
+ TaskModel::EVENT_MOVE_SWIMLANE => 'execute',
);
}
diff --git a/app/Subscriber/ProjectModificationDateSubscriber.php b/app/Subscriber/ProjectModificationDateSubscriber.php
index 62804a84..fee04eaa 100644
--- a/app/Subscriber/ProjectModificationDateSubscriber.php
+++ b/app/Subscriber/ProjectModificationDateSubscriber.php
@@ -3,7 +3,7 @@
namespace Kanboard\Subscriber;
use Kanboard\Event\GenericEvent;
-use Kanboard\Model\Task;
+use Kanboard\Model\TaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ProjectModificationDateSubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -11,14 +11,14 @@ class ProjectModificationDateSubscriber extends BaseSubscriber implements EventS
public static function getSubscribedEvents()
{
return array(
- Task::EVENT_CREATE_UPDATE => 'execute',
- Task::EVENT_CLOSE => 'execute',
- Task::EVENT_OPEN => 'execute',
- Task::EVENT_MOVE_SWIMLANE => 'execute',
- Task::EVENT_MOVE_COLUMN => 'execute',
- Task::EVENT_MOVE_POSITION => 'execute',
- Task::EVENT_MOVE_PROJECT => 'execute',
- Task::EVENT_ASSIGNEE_CHANGE => 'execute',
+ TaskModel::EVENT_CREATE_UPDATE => 'execute',
+ TaskModel::EVENT_CLOSE => 'execute',
+ TaskModel::EVENT_OPEN => 'execute',
+ TaskModel::EVENT_MOVE_SWIMLANE => 'execute',
+ TaskModel::EVENT_MOVE_COLUMN => 'execute',
+ TaskModel::EVENT_MOVE_POSITION => 'execute',
+ TaskModel::EVENT_MOVE_PROJECT => 'execute',
+ TaskModel::EVENT_ASSIGNEE_CHANGE => 'execute',
);
}
@@ -26,7 +26,7 @@ class ProjectModificationDateSubscriber extends BaseSubscriber implements EventS
{
if (isset($event['project_id']) && !$this->isExecuted()) {
$this->logger->debug('Subscriber executed: '.__METHOD__);
- $this->project->updateModificationDate($event['project_id']);
+ $this->projectModel->updateModificationDate($event['project_id']);
}
}
}
diff --git a/app/Subscriber/RecurringTaskSubscriber.php b/app/Subscriber/RecurringTaskSubscriber.php
index 09a5665a..75b7ff76 100644
--- a/app/Subscriber/RecurringTaskSubscriber.php
+++ b/app/Subscriber/RecurringTaskSubscriber.php
@@ -3,7 +3,7 @@
namespace Kanboard\Subscriber;
use Kanboard\Event\TaskEvent;
-use Kanboard\Model\Task;
+use Kanboard\Model\TaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class RecurringTaskSubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -11,8 +11,8 @@ class RecurringTaskSubscriber extends BaseSubscriber implements EventSubscriberI
public static function getSubscribedEvents()
{
return array(
- Task::EVENT_MOVE_COLUMN => 'onMove',
- Task::EVENT_CLOSE => 'onClose',
+ TaskModel::EVENT_MOVE_COLUMN => 'onMove',
+ TaskModel::EVENT_CLOSE => 'onClose',
);
}
@@ -20,11 +20,11 @@ class RecurringTaskSubscriber extends BaseSubscriber implements EventSubscriberI
{
$this->logger->debug('Subscriber executed: '.__METHOD__);
- if ($event['recurrence_status'] == Task::RECURRING_STATUS_PENDING) {
- if ($event['recurrence_trigger'] == Task::RECURRING_TRIGGER_FIRST_COLUMN && $this->column->getFirstColumnId($event['project_id']) == $event['src_column_id']) {
- $this->taskDuplication->duplicateRecurringTask($event['task_id']);
- } elseif ($event['recurrence_trigger'] == Task::RECURRING_TRIGGER_LAST_COLUMN && $this->column->getLastColumnId($event['project_id']) == $event['dst_column_id']) {
- $this->taskDuplication->duplicateRecurringTask($event['task_id']);
+ if ($event['recurrence_status'] == TaskModel::RECURRING_STATUS_PENDING) {
+ if ($event['recurrence_trigger'] == TaskModel::RECURRING_TRIGGER_FIRST_COLUMN && $this->columnModel->getFirstColumnId($event['project_id']) == $event['src_column_id']) {
+ $this->taskDuplicationModel->duplicateRecurringTask($event['task_id']);
+ } elseif ($event['recurrence_trigger'] == TaskModel::RECURRING_TRIGGER_LAST_COLUMN && $this->columnModel->getLastColumnId($event['project_id']) == $event['dst_column_id']) {
+ $this->taskDuplicationModel->duplicateRecurringTask($event['task_id']);
}
}
}
@@ -33,8 +33,8 @@ class RecurringTaskSubscriber extends BaseSubscriber implements EventSubscriberI
{
$this->logger->debug('Subscriber executed: '.__METHOD__);
- if ($event['recurrence_status'] == Task::RECURRING_STATUS_PENDING && $event['recurrence_trigger'] == Task::RECURRING_TRIGGER_CLOSE) {
- $this->taskDuplication->duplicateRecurringTask($event['task_id']);
+ if ($event['recurrence_status'] == TaskModel::RECURRING_STATUS_PENDING && $event['recurrence_trigger'] == TaskModel::RECURRING_TRIGGER_CLOSE) {
+ $this->taskDuplicationModel->duplicateRecurringTask($event['task_id']);
}
}
}
diff --git a/app/Subscriber/SubtaskTimeTrackingSubscriber.php b/app/Subscriber/SubtaskTimeTrackingSubscriber.php
index c0852bc8..7e39c126 100644
--- a/app/Subscriber/SubtaskTimeTrackingSubscriber.php
+++ b/app/Subscriber/SubtaskTimeTrackingSubscriber.php
@@ -3,7 +3,7 @@
namespace Kanboard\Subscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Kanboard\Model\Subtask;
+use Kanboard\Model\SubtaskModel;
use Kanboard\Event\SubtaskEvent;
class SubtaskTimeTrackingSubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -11,9 +11,9 @@ class SubtaskTimeTrackingSubscriber extends BaseSubscriber implements EventSubsc
public static function getSubscribedEvents()
{
return array(
- Subtask::EVENT_CREATE => 'updateTaskTime',
- Subtask::EVENT_DELETE => 'updateTaskTime',
- Subtask::EVENT_UPDATE => array(
+ SubtaskModel::EVENT_CREATE => 'updateTaskTime',
+ SubtaskModel::EVENT_DELETE => 'updateTaskTime',
+ SubtaskModel::EVENT_UPDATE => array(
array('logStartEnd', 10),
array('updateTaskTime', 0),
)
@@ -24,24 +24,24 @@ class SubtaskTimeTrackingSubscriber extends BaseSubscriber implements EventSubsc
{
if (isset($event['task_id'])) {
$this->logger->debug('Subscriber executed: '.__METHOD__);
- $this->subtaskTimeTracking->updateTaskTimeTracking($event['task_id']);
+ $this->subtaskTimeTrackingModel->updateTaskTimeTracking($event['task_id']);
}
}
public function logStartEnd(SubtaskEvent $event)
{
- if (isset($event['status']) && $this->config->get('subtask_time_tracking') == 1) {
+ if (isset($event['status']) && $this->configModel->get('subtask_time_tracking') == 1) {
$this->logger->debug('Subscriber executed: '.__METHOD__);
- $subtask = $this->subtask->getById($event['id']);
+ $subtask = $this->subtaskModel->getById($event['id']);
if (empty($subtask['user_id'])) {
return false;
}
- if ($subtask['status'] == Subtask::STATUS_INPROGRESS) {
- return $this->subtaskTimeTracking->logStartTime($subtask['id'], $subtask['user_id']);
+ if ($subtask['status'] == SubtaskModel::STATUS_INPROGRESS) {
+ return $this->subtaskTimeTrackingModel->logStartTime($subtask['id'], $subtask['user_id']);
} else {
- return $this->subtaskTimeTracking->logEndTime($subtask['id'], $subtask['user_id']);
+ return $this->subtaskTimeTrackingModel->logEndTime($subtask['id'], $subtask['user_id']);
}
}
}
diff --git a/app/Subscriber/TransitionSubscriber.php b/app/Subscriber/TransitionSubscriber.php
index bd537484..26d08f88 100644
--- a/app/Subscriber/TransitionSubscriber.php
+++ b/app/Subscriber/TransitionSubscriber.php
@@ -3,7 +3,7 @@
namespace Kanboard\Subscriber;
use Kanboard\Event\TaskEvent;
-use Kanboard\Model\Task;
+use Kanboard\Model\TaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class TransitionSubscriber extends BaseSubscriber implements EventSubscriberInterface
@@ -11,7 +11,7 @@ class TransitionSubscriber extends BaseSubscriber implements EventSubscriberInte
public static function getSubscribedEvents()
{
return array(
- Task::EVENT_MOVE_COLUMN => 'execute',
+ TaskModel::EVENT_MOVE_COLUMN => 'execute',
);
}
@@ -22,7 +22,7 @@ class TransitionSubscriber extends BaseSubscriber implements EventSubscriberInte
$user_id = $this->userSession->getId();
if (! empty($user_id)) {
- $this->transition->save($user_id, $event->getAll());
+ $this->transitionModel->save($user_id, $event->getAll());
}
}
}