Update Domain.php

This commit is contained in:
Bozhidar 2024-04-30 23:27:10 +03:00
parent f50776e8b6
commit dd3c93db37

View file

@ -135,16 +135,7 @@ class Domain extends Model
} }
if (empty($this->domain_root)) { if (empty($this->domain_root)) {
if ($this->is_main == 1) { throw new \Exception('Domain root not found');
$this->domain_root = '/home/'.$findHostingSubscription->system_username;
$this->domain_public = '/home/'.$findHostingSubscription->system_username.'/public_html';
$this->home_root = '/home/'.$findHostingSubscription->system_username;
} else {
$this->domain_root = '/home/'.$findHostingSubscription->system_username.'/domains/'.$this->domain;
$this->domain_public = $this->domain_root.'/public_html';
$this->home_root = '/home/'.$findHostingSubscription->system_username;
}
$this->save();
} }
if (!is_dir($this->domain_root)) { if (!is_dir($this->domain_root)) {