From 29682928a6ea5f77f4477e8b8e7204d1db9e6910 Mon Sep 17 00:00:00 2001 From: Barry O'Donovan Date: Thu, 20 Aug 2020 15:33:03 +0100 Subject: [PATCH] Log logins --- app/Listeners/Auth/LoginSuccessful.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Listeners/Auth/LoginSuccessful.php b/app/Listeners/Auth/LoginSuccessful.php index ddc619060..29f5a9b47 100644 --- a/app/Listeners/Auth/LoginSuccessful.php +++ b/app/Listeners/Auth/LoginSuccessful.php @@ -23,7 +23,7 @@ * http://www.gnu.org/licenses/gpl-2.0.html */ -use Auth, D2EM; +use Auth, D2EM, Log; use Entities\UserLoginHistory as UserLoginHistoryEntity; use Illuminate\Auth\Events\Login as LoginEvent; @@ -38,6 +38,8 @@ class LoginSuccessful { */ public function handle( LoginEvent $e ) { + Log::notice( 'Login successful for user "' .$e->user->getUsername(). '" from IP ' . ixp_get_client_ip() . '.' ); + if( !session()->exists( "switched_user_from" ) && $e->user->getCurrentCustomerToUser() ) { if( Auth::viaRemember() ) { $e->user->getCurrentCustomerToUser()->setLastLoginVia( 'RememberMe' );