Skip to content

Commit 1598280

Browse files
author
sebastianm
committed
Added function dns_rr_get_all_by_zone to remoting lib. Get all dns records for a zone.
1 parent 6eb625a commit 1598280

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,23 @@ public function dns_zone_get_by_user($session_id, $client_id, $server_id) {
25432543
return false;
25442544
}
25452545

2546-
2546+
/**
2547+
* Get all dns records for a zone
2548+
* @param int session id
2549+
* @param int dns zone id
2550+
* @author Sebastian Mogilowski <sebastian@mogilowski.net> 2011
2551+
*/
2552+
public function dns_rr_get_all_by_zone($session_id, $zone_id) {
2553+
global $app;
2554+
if(!$this->checkPerm($session_id, 'dns_zone_get')) {
2555+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
2556+
return false;
2557+
}
2558+
$sql = "SELECT * FROM dns_rr WHERE zone = ".intval($zone_id);;
2559+
$result = $app->db->queryAllRecords($sql);
2560+
return $result;
2561+
}
2562+
25472563
/**
25482564
* Changes DNS zone status
25492565
* @param int session id

0 commit comments

Comments
 (0)