From cfacadc769c9192e0386fb2a3f980c2344472e67 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 24 Dec 2018 22:42:15 -0700 Subject: [PATCH] Update AuthLogin listener --- app/Listeners/AuthLogin.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/Listeners/AuthLogin.php b/app/Listeners/AuthLogin.php index a69f86f8..ea29aa88 100644 --- a/app/Listeners/AuthLogin.php +++ b/app/Listeners/AuthLogin.php @@ -61,5 +61,30 @@ class AuthLogin CreateAvatar::dispatch($profile); }); } + + if($user->status != null) { + $profile = $user->profile; + switch ($user->status) { + case 'disabled': + $profile->status = null; + $user->status = null; + $profile->save(); + $user->save(); + break; + + case 'delete': + $profile->status = null; + $profile->delete_after = null; + $user->status = null; + $user->delete_after = null; + $profile->save(); + $user->save(); + break; + + default: + # code... + break; + } + } } }