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

28 lines
608 B
PHP
Raw Normal View History

2015-01-16 14:23:05 +01:00
<?php
namespace Subscriber;
use Core\Request;
use Event\AuthEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2015-08-16 17:04:56 +02:00
class AuthSubscriber extends \Core\Base implements EventSubscriberInterface
2015-01-16 14:23:05 +01:00
{
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()
);
}
}