blob: 77a399426735bd9500527397ed0342fd812861a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
namespace Kanboard\Subscriber;
use Kanboard\Core\Http\Request;
use Kanboard\Event\AuthEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class AuthSubscriber extends \Kanboard\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()
);
}
}
|