Skip to content

Commit 887e847

Browse files
author
Till Brehm
committed
Implemented #4242 Add secondary DNS api functions
1 parent aeb0a2b commit 887e847

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

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

Lines changed: 32 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,37 @@ 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+
//* Update a slave zone
211+
public function dns_slave_update($session_id, $client_id, $primary_id, $params)
212+
{
213+
if(!$this->checkPerm($session_id, 'dns_zone_update')) {
214+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
215+
return false;
216+
}
217+
$affected_rows = $this->updateQuery('../dns/form/dns_slave.tform.php', $client_id, $primary_id, $params);
218+
return $affected_rows;
219+
}
220+
221+
//* Delete a slave zone
222+
public function dns_slave_delete($session_id, $primary_id)
223+
{
224+
if(!$this->checkPerm($session_id, 'dns_zone_delete')) {
225+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
226+
return false;
227+
}
228+
return $this->deleteQuery('../dns/form/dns_slave.tform.php', $primary_id);
229+
}
199230

200231
//* Get record id by origin
201232
public function dns_zone_get_id($session_id, $origin)

0 commit comments

Comments
 (0)