From ffa064faf984365440587c966815c2ee7619bbff Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 3 Feb 2021 13:52:29 +0100 Subject: [PATCH] IDPS: action and status filter where excluded. closes https://github.com/opnsense/core/issues/4665 Although it looks nice to return the current configured rule overwrites, it's confusing when querying items. Remove the rule overwrites and only show what's being use now, needs an apply to update. --- .../controllers/OPNsense/IDS/Api/SettingsController.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php b/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php index ddd136ef8..591775078 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php @@ -107,7 +107,7 @@ class SettingsController extends ApiMutableModelControllerBase foreach ($_POST as $key => $value) { $key = $filter->sanitize($key, "string"); $value = $filter->sanitize($value, "string"); - if (!in_array($key, ['current', 'rowCount', 'sort', 'searchPhrase', 'action' ,'status'])) { + if (!in_array($key, ['current', 'rowCount', 'sort', 'searchPhrase'])) { $searchPhrase .= " {$key}/\"{$value}\" "; } } @@ -123,12 +123,6 @@ class SettingsController extends ApiMutableModelControllerBase if ($data != null && array_key_exists("rows", $data)) { $result = array(); $result['rows'] = $data['rows']; - // update rule status with own administration - foreach ($result['rows'] as &$row) { - $row['enabled'] = $this->getModel()->getRuleStatus($row['sid'], $row['enabled']); - $row['action'] = $this->getModel()->getRuleAction($row['sid'], $row['action'], true); - } - $result['rowCount'] = empty($result['rows']) || !is_array($result['rows']) ? 0 : count($result['rows']); $result['total'] = $data['total_rows']; $result['parameters'] = $data['parameters'];