added zone type

Signed-off-by: tracer <tracer@24unix.net>
This commit is contained in:
tracer 2022-04-06 16:26:08 +02:00
parent 2f79e39a8c
commit d6922be2a4

View File

@ -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;
}