Implemented logs and zone searching.

This commit is contained in:
Richard Underwood 2016-08-23 15:56:41 +01:00
parent 4b5d4b02c9
commit dde58c798c
3 changed files with 139 additions and 2 deletions

View file

@ -188,6 +188,31 @@ case "listrecords":
$zone = new Zone();
$zone->parse($zonedata);
$records = $zone->rrsets2records();
if(!empty($_POST['label'])) {
$records=array_filter($records,
function ($val) {
return(stripos($val['name'], $_POST['label']) !== FALSE);
}
);
}
if(!empty($_POST['type'])) {
$records=array_filter($records,
function ($val) {
return($val['type'] == $_POST['type']);
}
);
}
if(!empty($_POST['content'])) {
$records=array_filter($records,
function ($val) {
return(stripos($val['content'], $_POST['content']) !== FALSE);
}
);
}
if (isset($_GET['jtSorting'])) {
list($scolumn, $sorder) = preg_split("/ /", $_GET['jtSorting']);
switch ($scolumn) {
@ -488,4 +513,4 @@ default:
}
} catch (Exception $e) {
jtable_respond(null, 'error', $e->getMessage());
}
}