From d85bf8c0d8d42ac330604260fcd853284af39de1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 17 Jan 2025 10:34:09 +0100 Subject: [PATCH] system: configdpRun() needs to be used #8221 In the group case that is a refactor, in the user case that is a bugfix because the argument was not passed... --- .../app/controllers/OPNsense/Auth/Api/GroupController.php | 8 +++++--- .../app/controllers/OPNsense/Auth/Api/UserController.php | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/GroupController.php b/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/GroupController.php index 9da561618..c5559f6a6 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/GroupController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/GroupController.php @@ -69,7 +69,7 @@ class GroupController extends ApiMutableModelControllerBase $result = $this->addBase('group', 'group'); if ($result['result'] != 'failed') { $data = $this->request->getPost(static::$internalModelName); - (new Backend())->configdRun('auth sync group ' . $data['name']); + (new Backend())->configdpRun('auth sync group', [$data['name']]); } return $result; } @@ -79,7 +79,9 @@ class GroupController extends ApiMutableModelControllerBase $result = $this->setBase('group', 'group', $uuid); if ($result['result'] != 'failed') { $data = $this->request->getPost(static::$internalModelName); - (new Backend())->configdRun('auth sync group ' . $data['name']); + if (!empty($data['name'])) { + (new Backend())->configdpRun('auth sync group', [$data['name']]); + } } return $result; } @@ -99,7 +101,7 @@ class GroupController extends ApiMutableModelControllerBase } $result = $this->delBase('group', $uuid); if ($groupname != null) { - (new Backend())->configdRun('auth sync group ' . $groupname); + (new Backend())->configdpRun('auth sync group', [$groupname]); } return $result; } diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/UserController.php b/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/UserController.php index b2c393ad2..1b0b07751 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/UserController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Auth/Api/UserController.php @@ -155,7 +155,7 @@ class UserController extends ApiMutableModelControllerBase if ($result['result'] != 'failed') { $data = $this->request->getPost(static::$internalModelName); if (!empty($data['name'])) { - (new Backend())->configdRun('auth sync user', [$data['name']]); + (new Backend())->configdpRun('auth sync user', [$data['name']]); } } return $result; @@ -167,7 +167,7 @@ class UserController extends ApiMutableModelControllerBase if ($result['result'] != 'failed') { $data = $this->request->getPost(static::$internalModelName); if (!empty($data['name'])) { - (new Backend())->configdRun('auth sync user', [$data['name']]); + (new Backend())->configdpRun('auth sync user', [$data['name']]); } } return $result; @@ -196,7 +196,7 @@ class UserController extends ApiMutableModelControllerBase } $result = $this->delBase('user', $uuid); if ($username != null) { - (new Backend())->configdRun('auth sync user', [$username]); + (new Backend())->configdpRun('auth sync user', [$username]); } return $result; }