From d6922be2a4c4ba508b75dfc415ab2a519e830532 Mon Sep 17 00:00:00 2001 From: tracer Date: Wed, 6 Apr 2022 16:26:08 +0200 Subject: [PATCH] added zone type Signed-off-by: tracer --- src/Controller/BindAPI.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; }