diff --git a/api.php b/api.php index d9f22550..9b6c0da3 100644 --- a/api.php +++ b/api.php @@ -43,6 +43,10 @@ $data = array_merge($data, getQuerySources()); } + if (isset($_GET['getAllQueries'])) { + $data = array_merge($data, getAllQueries()); + } + echo json_encode($data); ?> diff --git a/data.php b/data.php index 1eb647ce..e57f2fc4 100644 --- a/data.php +++ b/data.php @@ -117,6 +117,26 @@ return $sources; } + function getAllQueries() { + $allQueries = array("data" => array()); + $log = readInLog(); + $dns_queries = getDnsQueries($log); + + foreach ($dns_queries as $query) { + $time = date_create(substr($query, 0, 16), new DateTimeZone('GMT'))->SetTimeZone(new DateTimeZone(date_default_timezone_get())); + + $exploded = explode(" ", trim($query)); + array_push($allQueries['data'], array( + $time->format('Y-m-d\TH:i:s'), + substr($exploded[4], 6, -1), + $exploded[5], + $exploded[7], + )); + } + + return $allQueries; + } + /******** Private Members ********/ function readInBlockList() { global $domains; diff --git a/footer.html b/footer.html index 70029a1f..593fe100 100644 --- a/footer.html +++ b/footer.html @@ -14,7 +14,8 @@ - + + diff --git a/header.html b/header.html index 04a52b6a..3d18992a 100644 --- a/header.html +++ b/header.html @@ -9,7 +9,7 @@ - + @@ -112,10 +112,10 @@ Main Page - +
  • - - Donate + + Query Log
  • @@ -130,6 +130,12 @@ Blacklist + +
  • + + Donate + +
  • diff --git a/queries.php b/queries.php new file mode 100644 index 00000000..301c4182 --- /dev/null +++ b/queries.php @@ -0,0 +1,69 @@ + + + +
    +
    +
    +
    +

    Recent Queries

    +
    + +
    + + + + + + + + + + + + + + + + + +
    TimeTypeDomainClient
    TimeTypeDomainClient
    +
    + +
    + +
    +
    + + + + + +