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

@ -27,7 +27,25 @@ case "list":
if ($logging !== TRUE)
jtable_respond(null, 'error', 'Logging is disabled');
jtable_respond(getlogs());
$entries=getlogs();
if(!empty($_POST['user'])) {
$entries=array_filter($entries,
function ($val) {
return(stripos($val['user'], $_POST['user']) !== FALSE);
}
);
}
if(!empty($_POST['entry'])) {
$entries=array_filter($entries,
function ($val) {
return(stripos($val['log'], $_POST['entry']) !== FALSE);
}
);
}
jtable_respond($entries);
break;
case "delete":