Commit abd8ffa9 authored by Ad Schellevis's avatar Ad Schellevis

(netflow, api) add simple isEnabled call

parent 1db247e7
...@@ -41,6 +41,22 @@ use \OPNsense\Core\Backend; ...@@ -41,6 +41,22 @@ use \OPNsense\Core\Backend;
*/ */
class NetflowController extends ApiControllerBase 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 * retrieve Netflow settings
* @return array * @return array
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment