minor cleanups.
This commit is contained in:
parent
4c872d76dd
commit
9af7b3cc01
3 changed files with 12 additions and 14 deletions
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace App\Listener;
|
namespace App\Listener;
|
||||||
|
|
||||||
use Phalcon\Events\Event;
|
use Phalcon\Events\Event,
|
||||||
use Phalcon\Mvc\Dispatcher;
|
Phalcon\Mvc\Dispatcher,
|
||||||
use Phalcon\Mvc\User\Plugin;
|
Phalcon\Mvc\User\Plugin;
|
||||||
|
|
||||||
use Httpcb\Acl;
|
use Httpcb\Acl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class ActivityLog extends Plugin
|
||||||
*/
|
*/
|
||||||
public function onLogin(Event $event, Auth $auth, $type)
|
public function onLogin(Event $event, Auth $auth, $type)
|
||||||
{
|
{
|
||||||
$this->_log($auth->getUser(), "Logged in ({$type})");
|
$this->_log($auth->getUser(), sprintf("Logged in (%s)", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,13 +55,11 @@ class ActivityLog extends Plugin
|
||||||
*/
|
*/
|
||||||
public function onOAuthConnected(Event $event, User $user, OAuthUserDataInterface $provider)
|
public function onOAuthConnected(Event $event, User $user, OAuthUserDataInterface $provider)
|
||||||
{
|
{
|
||||||
$name = $provider->getProvider();
|
$this->_log($user, sprintf("OAuth connected (%s)", $provider->getProvider()));
|
||||||
|
|
||||||
$this->_log($user, "OAuth connected ({$name})");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when a user is connected to a OAuth provider.
|
* Fired when a user is disconnected from a OAuth provider.
|
||||||
*
|
*
|
||||||
* @param Event $event
|
* @param Event $event
|
||||||
* @param User $user
|
* @param User $user
|
||||||
|
|
@ -69,7 +67,7 @@ class ActivityLog extends Plugin
|
||||||
*/
|
*/
|
||||||
public function onOAuthDisconnect(Event $event, User $user, $providerName)
|
public function onOAuthDisconnect(Event $event, User $user, $providerName)
|
||||||
{
|
{
|
||||||
$this->_log($user, "OAuth disconnected ({$providerName})");
|
$this->_log($user, sprintf("OAuth disconnected (%s)", $providerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _log(User $user, $message)
|
protected function _log(User $user, $message)
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace App\Listener;
|
namespace App\Listener;
|
||||||
|
|
||||||
use Exception;
|
use Exception,
|
||||||
use Phalcon\Events\Event;
|
Phalcon\Events\Event,
|
||||||
use Phalcon\Mvc\User\Plugin;
|
Phalcon\Mvc\User\Plugin,
|
||||||
use Phalcon\Mvc\Dispatcher;
|
Phalcon\Mvc\Dispatcher,
|
||||||
use Phalcon\Mvc\Dispatcher\Exception as DispatcherException;
|
Phalcon\Mvc\Dispatcher\Exception as DispatcherException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DispatchListener
|
* Class DispatchListener
|
||||||
|
|
|
||||||
Reference in a new issue