mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Add getzonekeys() to PdnsApi
This commit is contained in:
parent
367dde6f19
commit
f61f52a14d
1 changed files with 27 additions and 0 deletions
|
@ -79,6 +79,33 @@ class PdnsAPI {
|
|||
|
||||
return $api->json;
|
||||
}
|
||||
|
||||
public function getzonekeys($zoneid) {
|
||||
$ret = array();
|
||||
$api = clone $this->http;
|
||||
$api->method = 'GET';
|
||||
$api->url = "/servers/localhost/zones/$zoneid/cryptokeys"
|
||||
|
||||
$api->call();
|
||||
|
||||
foreach ($api->json as $key) {
|
||||
if (!isset($key['active']))
|
||||
continue;
|
||||
|
||||
$key['dstxt'] = $zoneid . ' IN DNSKEY '.$key['dnskey']."\n\n";
|
||||
|
||||
if (isset($key['ds'])) {
|
||||
foreach ($key['ds'] as $ds) {
|
||||
$key['dstxt'] .= $zoneid . ' IN DS '.$ds."\n";
|
||||
}
|
||||
unset($key['ds']);
|
||||
}
|
||||
array_push($ret, $key);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue