diff --git a/api_FTL.php b/api_FTL.php index e67405dc..041163f0 100644 --- a/api_FTL.php +++ b/api_FTL.php @@ -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")