mirror of
https://github.com/YunoHost-Apps/kanboard_ynh.git
synced 2024-09-03 19:36:17 +02:00
27 lines
608 B
PHP
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()
|
|
);
|
|
}
|
|
}
|