Skip to content

Commit 2d5e640

Browse files
author
Marius Burkard
committed
Merge branch 'master' into 'master'
Create/Delete Secondary DNS with remote API #4242 i just added a proposed code on howtoforge https://www.howtoforge.com/community/threads/create-delete-secondary-dns-with-remote-api.74136/ See merge request !460
2 parents f3e2d13 + d680f52 commit 2d5e640

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

interface/lib/classes/remote.d/dns.inc.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007 - 2013, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007 - 2016, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without modification,
@@ -196,6 +196,26 @@ public function dns_zone_get($session_id, $primary_id)
196196
$app->remoting_lib->loadFormDef('../dns/form/dns_soa.tform.php');
197197
return $app->remoting_lib->getDataRecord($primary_id);
198198
}
199+
200+
//* Add a slave zone
201+
public function dns_slave_add($session_id, $client_id, $params)
202+
{
203+
if(!$this->checkPerm($session_id, 'dns_zone_add')) {
204+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
205+
return false;
206+
}
207+
return $this->insertQuery('../dns/form/dns_slave.tform.php', $client_id, $params);
208+
}
209+
210+
//* Delete a slave zone
211+
public function dns_slave_delete($session_id, $primary_id)
212+
{
213+
if(!$this->checkPerm($session_id, 'dns_zone_delete')) {
214+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
215+
return false;
216+
}
217+
return $this->deleteQuery('../dns/form/dns_slave.tform.php', $primary_id);
218+
}
199219

200220
//* Get record id by origin
201221
public function dns_zone_get_id($session_id, $origin)

0 commit comments

Comments
 (0)