diff --git a/src/Controller/BindAPI.php b/src/Controller/BindAPI.php index 4f642d2..b30bc3d 100755 --- a/src/Controller/BindAPI.php +++ b/src/Controller/BindAPI.php @@ -384,6 +384,7 @@ class BindAPI return true; } + /** * @param String $domainName * @param \App\Entity\Panel $panel @@ -470,6 +471,7 @@ class BindAPI exit(1); } if ($create['header'] != 201) { + print_r(value: $create); die("make error handling"); } else { echo COLOR_GREEN . 'OK' . COLOR_DEFAULT; @@ -1011,7 +1013,7 @@ class BindAPI } if (!empty($domains)) { $table = new ConsoleTable(); - $table->setHeaders(content: ['ID', 'Name', 'Panel']); + $table->setHeaders(content: ['ID', 'Name', 'Panel', 'Type']); /** @var Domain $domain */ foreach ($domains as $domain) { $row = []; @@ -1019,6 +1021,7 @@ class BindAPI $row[] = $domain->getId(); $row[] = $domain->getName(); $row[] = $domain->getPanel(); + $row[] = $this->domainController->isMasterZone(domain: $domain) ? 'MASTER' : 'SLAVE'; } catch (DependencyException|NotFoundException $e) { echo $e->getMessage(); } @@ -1105,14 +1108,14 @@ class BindAPI if (empty($name) && empty($panel)) { echo 'No name or panel given, just recreate the config file' . PHP_EOL; - $this->domainController->createSlaveZoneFile(domain: $domain); + $this->domainController->updateSlaveZones(); exit(1); } $newDomain = new Domain(name: $name, panel: $panelName, id: $domain->getId()); if ($this->domainRepository->update(domain: $newDomain) !== false) { echo 'Domain server has been updated' . PHP_EOL; - $this->domainController->createSlaveZoneFile(domain: $domain); + $this->domainController->updateSlaveZones(); } else { echo 'Error while updating domain server.' . PHP_EOL; }