Compare commits
No commits in common. "073d9cae9e166f49ffa5c64fcc232719d40469f4" and "1bf327cc0072ab048c1e6524b454d7d89a81e810" have entirely different histories.
073d9cae9e
...
1bf327cc00
|
@ -152,6 +152,7 @@ class BindAPI
|
||||||
{
|
{
|
||||||
$nameServers = $this->nameserverController->findAll();
|
$nameServers = $this->nameserverController->findAll();
|
||||||
foreach($nameServers as $nameServer) {
|
foreach($nameServers as $nameServer) {
|
||||||
|
echo COLOR_DEFAULT . ' ' . $nameServer['name'];
|
||||||
if (!empty($nameServer['aaaa'])) {
|
if (!empty($nameServer['aaaa'])) {
|
||||||
$result = $this->checkController->sendCommand(serverName: $nameServer['name'],
|
$result = $this->checkController->sendCommand(serverName: $nameServer['name'],
|
||||||
versionIP: 6,
|
versionIP: 6,
|
||||||
|
@ -195,6 +196,8 @@ class BindAPI
|
||||||
post: true,
|
post: true,
|
||||||
body: $body);
|
body: $body);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
echo 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,10 +233,15 @@ class BindAPI
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
$domains = json_decode(json: $result['data']);
|
$domains = json_decode(json: $result['data']);
|
||||||
|
if ($domains['error']) {
|
||||||
|
echo $domains['data'];
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
$maxDomainName = 0;
|
$maxDomainName = 0;
|
||||||
// TODO this is ugly code
|
// TODO this is ugly code
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
if (($domain->id_parent_domain == 0 && !str_contains(haystack: $domain->domain, needle: $panel['name'])) && (strlen(string: $domain->domain) > $maxDomainName)) {
|
if (($domain->id_parent_domain == 0 && !str_contains(haystack: $domain->domain, needle: $panel['name'])) && (strlen(string: $domain->domain) > $maxDomainName)) {
|
||||||
$maxDomainName = strlen(string: $domain->domain);
|
$maxDomainName = strlen(string: $domain->domain);
|
||||||
|
|
|
@ -63,9 +63,8 @@ class CheckController
|
||||||
case 401:
|
case 401:
|
||||||
$result = 'Missing or wrong API Key';
|
$result = 'Missing or wrong API Key';
|
||||||
break;
|
break;
|
||||||
case 404:
|
|
||||||
$result = '404 Not Found';
|
|
||||||
default:
|
default:
|
||||||
|
echo __FILE__, __LINE__, $resultJSON;
|
||||||
$result = 'Unhandled error: ' . $httpResponse;
|
$result = 'Unhandled error: ' . $httpResponse;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -74,7 +73,7 @@ class CheckController
|
||||||
}
|
}
|
||||||
curl_close(handle: $curl);
|
curl_close(handle: $curl);
|
||||||
return [
|
return [
|
||||||
'error' => $error,
|
'error' => true,
|
||||||
'data' => $result,
|
'data' => $result,
|
||||||
'header' => $httpResponse ?? ''
|
'header' => $httpResponse ?? ''
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue