chenged from content to panel
Signed-off-by: tracer <tracer@24unix.net>
This commit is contained in:
parent
8c7755e096
commit
18112b7937
|
@ -117,7 +117,7 @@ class DomainController
|
||||||
$bindGroup = posix_getgrnam(name: 'bind');
|
$bindGroup = posix_getgrnam(name: 'bind');
|
||||||
$members = $bindGroup['members'];
|
$members = $bindGroup['members'];
|
||||||
if (in_array(needle: $name, haystack: $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 {
|
} else {
|
||||||
echo "\t❌$name needs to be in group $bindGroup!" . PHP_EOL;
|
echo "\t❌$name needs to be in group $bindGroup!" . PHP_EOL;
|
||||||
|
|
||||||
|
@ -211,15 +211,13 @@ class DomainController
|
||||||
|
|
||||||
// check if we're a master zone
|
// check if we're a master zone
|
||||||
$keyhelpConf = file_get_contents(filename: $this->keyhelpNamedCond);
|
$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;
|
echo 'We a zone master for ' . $domain->getName() . PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($zonefile = fopen(filename: $this->localZonesDir . $domain->getName(), mode: 'w')) {
|
if ($zonefile = fopen(filename: $this->localZonesDir . $domain->getName(), mode: 'w')) {
|
||||||
// TODO fixme soon
|
$panelName = $domain->getPanel();
|
||||||
$content = json_decode(json: $domain->getContent());
|
|
||||||
$panelName = $content->panel;
|
|
||||||
$panel = $this->panelRepository->findByName(name: $panelName);
|
$panel = $this->panelRepository->findByName(name: $panelName);
|
||||||
$a = $panel->getA();
|
$a = $panel->getA();
|
||||||
$aaaa = $panel->getAaaa();
|
$aaaa = $panel->getAaaa();
|
||||||
|
@ -237,42 +235,7 @@ class DomainController
|
||||||
fputs(stream: $zonefile, data: "};" . PHP_EOL);
|
fputs(stream: $zonefile, data: "};" . PHP_EOL);
|
||||||
}
|
}
|
||||||
$this->createIncludeFile();
|
$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
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue