From 18112b7937c4862bd1cdc339f8ad90bf662b46b4 Mon Sep 17 00:00:00 2001 From: tracer Date: Tue, 22 Feb 2022 15:32:23 +0100 Subject: [PATCH] chenged from content to panel Signed-off-by: tracer --- src/Controller/DomainController.php | 43 ++--------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/src/Controller/DomainController.php b/src/Controller/DomainController.php index 99f07aa..3cca68e 100644 --- a/src/Controller/DomainController.php +++ b/src/Controller/DomainController.php @@ -117,7 +117,7 @@ class DomainController $bindGroup = posix_getgrnam(name: 'bind'); $members = $bindGroup['members']; if (in_array(needle: $name, haystack: $members)) { - echo "\t✅ is in group 'bind" . PHP_EOL; + echo "\t✅ $name is in group 'bind" . PHP_EOL; } else { echo "\t❌$name needs to be in group $bindGroup!" . PHP_EOL; @@ -211,15 +211,13 @@ class DomainController // check if we're a master zone $keyhelpConf = file_get_contents(filename: $this->keyhelpNamedCond); - if (str_contains($keyhelpConf, $domain->getName())) { + if (str_contains(haystack: $keyhelpConf, needle: $domain->getName())) { echo 'We a zone master for ' . $domain->getName() . PHP_EOL; exit(1); } if ($zonefile = fopen(filename: $this->localZonesDir . $domain->getName(), mode: 'w')) { - // TODO fixme soon - $content = json_decode(json: $domain->getContent()); - $panelName = $content->panel; + $panelName = $domain->getPanel(); $panel = $this->panelRepository->findByName(name: $panelName); $a = $panel->getA(); $aaaa = $panel->getAaaa(); @@ -237,42 +235,7 @@ class DomainController fputs(stream: $zonefile, data: "};" . PHP_EOL); } $this->createIncludeFile(); - - // TODO add on nameservers - } - - /** - * @param String $panel - * - * @return String - */ - function createPanelContent(String $panel): String - { - return json_encode(value: [ - 'panel' => $panel - ] - ); } - /** - * @param array $ip - * - * @return String - */ - function createIPContent(array $ip): String - { - $result = []; - if (!empty($ip['a'])) { - $result['a'] = $ip['a']; - } - if (!empty($ip['aaaa'])) { - $result['aaaa'] = $ip['aaaa']; - } - - return json_encode(value: [ - 'custom' => $result - ] - ); - } } \ No newline at end of file