mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
(netflow, api) add simple isEnabled call
This commit is contained in:
parent
1db247e7db
commit
abd8ffa915
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user