1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Subscriber/AuthSubscriber.php
2015-01-16 14:23:05 +01:00

27 lines
602 B
PHP

<?php
namespace Subscriber;
use Core\Request;
use Event\AuthEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class AuthSubscriber extends Base implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
'auth.success' => array('onSuccess', 0),
);
}
public function onSuccess(AuthEvent $event)
{
$this->lastLogin->create(
$event->getAuthType(),
$event->getUserId(),
Request::getIpAddress(),
Request::getUserAgent()
);
}
}