Update HostingSubscription.php

This commit is contained in:
Bozhidar 2024-08-05 14:40:58 +03:00
parent b80f6d04ca
commit f77ccb6929

View file

@ -53,7 +53,7 @@ class HostingSubscription extends Model
$model->system_username = $create['system_username'];
$model->system_password = $create['system_password'];
} else {
return false;
throw new \Exception('System username or password not created');
}
});
@ -167,6 +167,17 @@ class HostingSubscription extends Model
if (strpos($createLinuxWebUserOutput, 'Creating home directory') !== false) {
// Check user is created
$getLinuxUser = new GetLinuxUser();
$getLinuxUser->setUsername($systemUsername);
$linuxUser = $getLinuxUser->handle();
if (empty($linuxUser)) {
return [
'error' => true,
'message' => 'System username not created.'
];
}
return [
'system_username' => $systemUsername,
'system_password' => $systemPassword