From 772804add8095eea9b3ec2a832c2f82fbb9a6fd5 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 31 Dec 2014 12:37:15 -0500 Subject: Acl refactoring --- app/Subscriber/Base.php | 1 + app/Subscriber/BootstrapSubscriber.php | 4 ++-- app/Subscriber/ProjectActivitySubscriber.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'app/Subscriber') diff --git a/app/Subscriber/Base.php b/app/Subscriber/Base.php index 5f884b39..abc051b3 100644 --- a/app/Subscriber/Base.php +++ b/app/Subscriber/Base.php @@ -19,6 +19,7 @@ use Pimple\Container; * @property \Model\Task $task * @property \Model\TaskExport $taskExport * @property \Model\TaskFinder $taskFinder + * @property \Model\UserSession $userSession */ abstract class Base { diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php index 30b8f168..e256159a 100644 --- a/app/Subscriber/BootstrapSubscriber.php +++ b/app/Subscriber/BootstrapSubscriber.php @@ -16,7 +16,7 @@ class BootstrapSubscriber extends Base implements EventSubscriberInterface public function setup() { - $this->container['config']->setupTranslations(); - $this->container['config']->setupTimezone(); + $this->config->setupTranslations(); + $this->config->setupTimezone(); } } diff --git a/app/Subscriber/ProjectActivitySubscriber.php b/app/Subscriber/ProjectActivitySubscriber.php index 1aca8539..3daf2f4d 100644 --- a/app/Subscriber/ProjectActivitySubscriber.php +++ b/app/Subscriber/ProjectActivitySubscriber.php @@ -30,14 +30,14 @@ class ProjectActivitySubscriber extends Base implements EventSubscriberInterface public function execute(GenericEvent $event) { // Executed only when someone is logged - if ($this->container['acl']->isLogged() && isset($event['task_id'])) { + if ($this->userSession->isLogged() && isset($event['task_id'])) { $values = $this->getValues($event); $this->projectActivity->createEvent( $values['task']['project_id'], $values['task']['id'], - $this->acl->getUserId(), + $this->userSession->getId(), $event->getName(), $values ); -- cgit v1.2.3