From 88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 27 Dec 2014 21:11:11 -0500 Subject: Add more subscribers --- app/Subscriber/AuthSubscriber.php | 27 +++++++++++++++++++++++++++ app/Subscriber/BootstrapSubscriber.php | 22 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 app/Subscriber/AuthSubscriber.php create mode 100644 app/Subscriber/BootstrapSubscriber.php (limited to 'app/Subscriber') diff --git a/app/Subscriber/AuthSubscriber.php b/app/Subscriber/AuthSubscriber.php new file mode 100644 index 00000000..161a7afd --- /dev/null +++ b/app/Subscriber/AuthSubscriber.php @@ -0,0 +1,27 @@ + array('onSuccess', 0), + ); + } + + public function onSuccess(AuthEvent $event) + { + $this->lastLogin->create( + $event->getAuthType(), + $event->getUserId(), + Request::getIpAddress(), + Request::getUserAgent() + ); + } +} diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php new file mode 100644 index 00000000..30b8f168 --- /dev/null +++ b/app/Subscriber/BootstrapSubscriber.php @@ -0,0 +1,22 @@ + array('setup', 0), + 'api.bootstrap' => array('setup', 0), + ); + } + + public function setup() + { + $this->container['config']->setupTranslations(); + $this->container['config']->setupTimezone(); + } +} -- cgit v1.2.3