Commit 887e8471 authored by Till Brehm's avatar Till Brehm
Browse files

Implemented #4242 Add secondary DNS api functions

parent aeb0a2bb
<?php
/*
Copyright (c) 2007 - 2013, Till Brehm, projektfarm Gmbh
Copyright (c) 2007 - 2016, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
......@@ -196,6 +196,37 @@ class remoting_dns extends remoting {
$app->remoting_lib->loadFormDef('../dns/form/dns_soa.tform.php');
return $app->remoting_lib->getDataRecord($primary_id);
}
//* Add a slave zone
public function dns_slave_add($session_id, $client_id, $params)
{
if(!$this->checkPerm($session_id, 'dns_zone_add')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
return $this->insertQuery('../dns/form/dns_slave.tform.php', $client_id, $params);
}
//* Update a slave zone
public function dns_slave_update($session_id, $client_id, $primary_id, $params)
{
if(!$this->checkPerm($session_id, 'dns_zone_update')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$affected_rows = $this->updateQuery('../dns/form/dns_slave.tform.php', $client_id, $primary_id, $params);
return $affected_rows;
}
//* Delete a slave zone
public function dns_slave_delete($session_id, $primary_id)
{
if(!$this->checkPerm($session_id, 'dns_zone_delete')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
return $this->deleteQuery('../dns/form/dns_slave.tform.php', $primary_id);
}
//* Get record id by origin
public function dns_zone_get_id($session_id, $origin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment