Merge branch 'devel' into TopItems

This commit is contained in:
DL6ER
2017-01-02 11:25:05 +01:00
8 changed files with 221 additions and 34 deletions

View File

@@ -334,6 +334,15 @@
// Create empty array for gravity
$gravity_domains = getGravity();
if(isset($_GET["from"]))
{
$from = new DateTime($_GET["from"]);
}
if(isset($_GET["until"]))
{
$until = new DateTime($_GET["until"]);
}
setShowBlockedPermitted();
// Privacy mode?
@@ -349,7 +358,26 @@
}
foreach ($dns_queries as $query) {
$time = date_create(substr($query, 0, 16));
$time = new DateTime(substr($query, 0, 16));
// Check if we want to restrict the time where we want to show queries
if(isset($from))
{
if($time <= $from)
{
continue;
}
}
if(isset($until))
{
if($time >= $until)
{
continue;
}
}
// print_r([$time->getTimestamp(),$_GET["from"],$_GET["until"]]);
$exploded = explode(" ", trim($query));
$domain = $exploded[count($exploded)-3];
$tmp = $exploded[count($exploded)-4];
@@ -508,7 +536,7 @@
$log->rewind();
$lines = [];
foreach ($log as $line) {
$exploded = explode(" ", $line);
$exploded = explode(" ", str_replace(" "," ",$line));
if(count($exploded) == 8 || count($exploded) == 10) {
// Structure of data is currently like:
// Array