From f5cb5e82632159597bc8d5a06fc7657671c5b126 Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Thu, 4 Apr 2024 15:42:33 +0300 Subject: [PATCH] Update ModelCustomerCreatedListener.php --- web/app/Listeners/ModelCustomerCreatedListener.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/app/Listeners/ModelCustomerCreatedListener.php b/web/app/Listeners/ModelCustomerCreatedListener.php index db6bf03..54f0d6e 100644 --- a/web/app/Listeners/ModelCustomerCreatedListener.php +++ b/web/app/Listeners/ModelCustomerCreatedListener.php @@ -58,16 +58,13 @@ class ModelCustomerCreatedListener $createLinuxWebUser->setPassword($password); $createLinuxWebUserOutput = $createLinuxWebUser->handle(); - - dd($createLinuxWebUserOutput); - - - $findCustomer->username = $generateUsername . $findCustomer->id; - $findCustomer->save(); + if (strpos($createLinuxWebUserOutput, 'Creating home directory') !== false) { + $findCustomer->username = $generateUsername . $findCustomer->id; + $findCustomer->save(); + } } - private static function _generateUsername($fullName) { $removedMultispace = preg_replace('/\s+/', ' ', $fullName);