From 7e0c8c35ccde081155183610267d50ce599b80e0 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Wed, 13 Oct 2021 11:17:29 +0200 Subject: [PATCH] Add ipv6 option for dns_templatezone_add() --- interface/lib/classes/remote.d/dns.inc.php | 3 ++- remoting_client/examples/dns_templatezone_add.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/remote.d/dns.inc.php b/interface/lib/classes/remote.d/dns.inc.php index b5d4b3820c..5cae8b3556 100644 --- a/interface/lib/classes/remote.d/dns.inc.php +++ b/interface/lib/classes/remote.d/dns.inc.php @@ -42,7 +42,7 @@ class remoting_dns extends remoting { // DNS Function -------------------------------------------------------------------------------------------------- //* Create Zone with Template - public function dns_templatezone_add($session_id, $client_id, $template_id, $domain, $ip, $ns1, $ns2, $email) { + public function dns_templatezone_add($session_id, $client_id, $template_id, $domain, $ip, $ns1, $ns2, $email, $ipv6 = '') { global $app, $conf; if(!$this->checkPerm($session_id, 'dns_templatezone_add')) { throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); @@ -63,6 +63,7 @@ class remoting_dns extends remoting { $tpl_content = $template_record['template']; if($domain != '') $tpl_content = str_replace('{DOMAIN}', $domain, $tpl_content); if($ip != '') $tpl_content = str_replace('{IP}', $ip, $tpl_content); + if($ipv6 != '') $tpl_content = str_replace('{IPV6}', $ipv6, $tpl_content); if($ns1 != '') $tpl_content = str_replace('{NS1}', $ns1, $tpl_content); if($ns2 != '') $tpl_content = str_replace('{NS2}', $ns2, $tpl_content); if($email != '') $tpl_content = str_replace('{EMAIL}', $email, $tpl_content); diff --git a/remoting_client/examples/dns_templatezone_add.php b/remoting_client/examples/dns_templatezone_add.php index aedfc61f5d..fa45965b48 100644 --- a/remoting_client/examples/dns_templatezone_add.php +++ b/remoting_client/examples/dns_templatezone_add.php @@ -32,8 +32,9 @@ try { $ns1 = 'ns1.testhoster.tld'; $ns2 = 'ns2.testhoster.tld'; $email = 'email.test.tld'; + $ipv6 = '2606:2800:220:1:248:1893:25c8:1946'; - $id = $client->dns_templatezone_add($session_id, $client_id, $template_id, $domain, $ip, $ns1, $ns2, $email); + $id = $client->dns_templatezone_add($session_id, $client_id, $template_id, $domain, $ip, $ns1, $ns2, $email, $ipv6); echo "ID: ".$id."
"; @@ -47,4 +48,4 @@ try { die('SOAP Error: '.$e->getMessage()); } -?> \ No newline at end of file +?> -- GitLab