(netflow, api) add simple isEnabled call

This commit is contained in:
Ad Schellevis 2016-04-22 14:39:52 +02:00
parent 1db247e7db
commit abd8ffa915

View File

@ -41,6 +41,22 @@ use \OPNsense\Core\Backend;
*/
class NetflowController extends ApiControllerBase
{
/**
*
*/
public function isEnabledAction()
{
$result = array('netflow' => 0, "local" => 0);
$mdlNetflow = new Netflow();
if ((string)$mdlNetflow->capture->targets != "" && (string)$mdlNetflow->capture->interfaces != "") {
$result['netflow'] = 1;
if ((string)$mdlNetflow->collect->enable == 1) {
$result['local'] = 1;
}
}
return $result;
}
/**
* retrieve Netflow settings
* @return array