From 9d41d8172bc338b23c8945ec2d0ec30cf8d2b53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 6 Oct 2025 17:04:30 +0200 Subject: [PATCH] fix(ldap): Fix wizard controller action route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems naming a route parameter $action causes issue, so renamed it to $wizardAction. Signed-off-by: Côme Chilliet Signed-off-by: Louis Chmn --- apps/user_ldap/lib/Controller/WizardController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/user_ldap/lib/Controller/WizardController.php b/apps/user_ldap/lib/Controller/WizardController.php index 92391e42a8a..302ab95b7ed 100644 --- a/apps/user_ldap/lib/Controller/WizardController.php +++ b/apps/user_ldap/lib/Controller/WizardController.php @@ -44,11 +44,14 @@ class WizardController extends OCSController { * 200: Wizard action result */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'POST', url: '/api/v1/wizard/{configID}/{action}')] - public function action(string $configID, string $action, ?string $loginName, ?string $key, ?string $val) { + #[ApiRoute(verb: 'POST', url: '/api/v1/wizard/{configID}/{wizardAction}')] + public function action( + string $configID, string $wizardAction, + ?string $loginName = null, ?string $key = null, ?string $val = null, + ) { try { $wizard = $this->wizardFactory->get($configID); - switch ($action) { + switch ($wizardAction) { case 'guessPortAndTLS': case 'guessBaseDN': case 'detectEmailAttribute': @@ -66,7 +69,7 @@ class WizardController extends OCSController { case 'countGroups': case 'countInBaseDN': try { - $result = $wizard->$action(); + $result = $wizard->$wizardAction(); if ($result !== false) { return new DataResponse($result->getResultArray()); } @@ -80,7 +83,7 @@ class WizardController extends OCSController { if ($loginName === null || $loginName === '') { throw new OCSException('No login name passed'); } - $result = $wizard->$action($loginName); + $result = $wizard->$wizardAction($loginName); if ($result !== false) { return new DataResponse($result->getResultArray()); }