diff --git a/app/Listeners/AuthLogin.php b/app/Listeners/AuthLogin.php index a69f86f81..ea29aa88d 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; + } + } } }