Add "api.php?topClientsBlocked"

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-05-10 15:05:46 +02:00
parent 504caf37e5
commit 5a473ecbde
+32
View File
@@ -173,6 +173,38 @@ else
$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")