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-08-16 17:04:57 +02:00

27 lines
608 B
PHP

<?php
namespace Subscriber;
use Core\Request;
use Event\AuthEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class AuthSubscriber extends \Core\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()
);
}
}