Skip to content

Commit

Permalink
Add "api.php?topClientsBlocked"
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed May 10, 2018
1 parent 504caf3 commit 5a473ec
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions api_FTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,38 @@
$data = array_merge($data, $result);
}

if (isset($_GET['topClientsBlocked']) && $auth)
{

if(isset($_GET['topClientsBlocked']))
{
$number = $_GET['topClientsBlocked'];
}

if(is_numeric($number))
{
sendRequestFTL("top-clients blocked (".$number.")");
}
else
{
sendRequestFTL("top-clients blocked");
}

$return = getResponseFTL();
$top_clients = array();
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) > 3 && strlen($tmp[3]) > 0)
$top_clients[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
else
$top_clients[$tmp[2]] = intval($tmp[1]);
}

$result = array('top_sources_blocked' => $top_clients);
$data = array_merge($data, $result);
}

if (isset($_GET['getForwardDestinations']) && $auth)
{
if($_GET['getForwardDestinations'] === "unsorted")
Expand Down

0 comments on commit 5a473ec

Please sign in to comment.