From f402de8021e3e72b80f4efd895f493472e09b079 Mon Sep 17 00:00:00 2001 From: Fabian Helfer Date: Thu, 5 Feb 2026 11:57:37 +0100 Subject: [PATCH 1/3] [Improvement] Auth: Tab SOAP Access Restriction Form --- .../classes/class.ilObjAuthSettingsGUI.php | 75 +++++++++++++------ 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php index 2ff47156ac79..8e9416e137e2 100755 --- a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php +++ b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php @@ -562,7 +562,8 @@ public function setAuthModeObject(): void } private function buildSOAPForm( - string $submit_action + string $submit_action, + string $show_action ): \ILIAS\UI\Component\Input\Container\Form\Form { $role_list = $this->rbac_review->getRolesByFilter(2, $this->object->getId()); $roles = []; @@ -671,27 +672,38 @@ private function buildSOAPForm( ) ->withValue((bool) $this->settings->get('soap_auth_user_default_role', '')); + $access = $this->rbac_system->checkAccess('write', $this->object->getRefId()); + $inputs = [ + 'active' => $active, + 'server' => $server, + 'port' => $port, + 'use_https' => $use_https, + 'uri' => $uri, + 'namespace' => $namespace, + 'dotnet' => $dotnet, + 'createuser' => $createuser, + 'sendmail' => $sendmail, + 'defaultrole' => $defaultrole, + 'allowlocal' => $allowlocal + ]; + if (!$access) { + foreach ($inputs as $key => $input) { + $inputs[$key] = $input->withDisabled(true); + } + } $form = $this->ui_factory->input()->container()->form()->standard( - $submit_action, - [ - 'active' => $active, - 'server' => $server, - 'port' => $port, - 'use_https' => $use_https, - 'uri' => $uri, - 'namespace' => $namespace, - 'dotnet' => $dotnet, - 'createuser' => $createuser, - 'sendmail' => $sendmail, - 'defaultrole' => $defaultrole, - 'allowlocal' => $allowlocal - ] + $access ? $submit_action : $show_action, + $inputs ); + + if (!$access) { + $form = $form->withSubmitLabel($this->lng->txt('refresh')); + } return $form; } private function buildSOAPTestForm( - string $submit_action + string $submit_action, ): \ILIAS\UI\Component\Input\Container\Form\Form { $ext_uid = $this->ui_factory->input()->field()->text( 'ext_uid' @@ -708,7 +720,7 @@ private function buildSOAPTestForm( 'soap_pw' => $soap_pw, 'new_user' => $new_user ] - )->withSubmitLabel('Send'); + )->withSubmitLabel($this->lng->txt('send')); } public function editSOAPObject(): void @@ -717,8 +729,14 @@ public function editSOAPObject(): void $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE); } - $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP')); - $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection')); + $soap_form = $this->buildSOAPForm( + $this->ctrl->getFormAction($this, 'saveSOAP'), + $this->ctrl->getFormAction($this, 'editSOAP') + ); + $test_form = $this->buildSOAPTestForm( + $this->ctrl->getFormAction($this, 'testSoapAuthConnection'), + $this->ctrl->getFormAction($this, 'editSOAP') + ); $this->tabs_gui->setTabActive('auth_soap'); $panel = $this->ui_factory->panel()->standard('SOAP', [$soap_form, $test_form]); @@ -731,15 +749,18 @@ public function testSoapAuthConnectionObject(): void $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE); } - $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP')); - $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection')); + $soap_form = $this->buildSOAPForm( + $this->ctrl->getFormAction($this, 'saveSOAP'), + $this->ctrl->getFormAction($this, 'editSOAP') + ); + $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection'),); $panel_content = [$soap_form, $test_form]; if ($this->request->getMethod() === 'POST') { $test_form = $test_form->withRequest($this->request); $result = $test_form->getData(); if ($result !== null) { $panel_content[] = $this->ui_factory->legacy()->content( - ilSOAPAuth::testConnection($result['ext_uid'], $result['soap_pw'], $result['new_user']) + ilAuthSOAP::testConnection($result['ext_uid'], $result['soap_pw'], $result['new_user']) ); } } @@ -754,8 +775,14 @@ public function saveSOAPObject(): void $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE); } - $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP')); - $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection')); + $soap_form = $this->buildSOAPForm( + $this->ctrl->getFormAction($this, 'saveSOAP'), + $this->ctrl->getFormAction($this, 'editSOAP') + ); + $test_form = $this->buildSOAPTestForm( + $this->ctrl->getFormAction($this, 'testSoapAuthConnection'), + $this->ctrl->getFormAction($this, 'editSOAP') + ); if ($this->request->getMethod() === 'POST') { $soap_form = $soap_form->withRequest($this->request); $result = $soap_form->getData(); From f84965d87d4b6606650b21bf36acd85e3c1d1509 Mon Sep 17 00:00:00 2001 From: Fabian Helfer Date: Thu, 5 Feb 2026 12:43:48 +0100 Subject: [PATCH 2/3] [Improvement] Auth: Tab SOAP CS-Fixer --- .../Authentication/classes/class.ilObjAuthSettingsGUI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php index 8e9416e137e2..76a8d17243f0 100755 --- a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php +++ b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php @@ -735,7 +735,6 @@ public function editSOAPObject(): void ); $test_form = $this->buildSOAPTestForm( $this->ctrl->getFormAction($this, 'testSoapAuthConnection'), - $this->ctrl->getFormAction($this, 'editSOAP') ); $this->tabs_gui->setTabActive('auth_soap'); @@ -753,7 +752,9 @@ public function testSoapAuthConnectionObject(): void $this->ctrl->getFormAction($this, 'saveSOAP'), $this->ctrl->getFormAction($this, 'editSOAP') ); - $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection'),); + $test_form = $this->buildSOAPTestForm( + $this->ctrl->getFormAction($this, 'testSoapAuthConnection') + ); $panel_content = [$soap_form, $test_form]; if ($this->request->getMethod() === 'POST') { $test_form = $test_form->withRequest($this->request); @@ -781,7 +782,6 @@ public function saveSOAPObject(): void ); $test_form = $this->buildSOAPTestForm( $this->ctrl->getFormAction($this, 'testSoapAuthConnection'), - $this->ctrl->getFormAction($this, 'editSOAP') ); if ($this->request->getMethod() === 'POST') { $soap_form = $soap_form->withRequest($this->request); From ce1db283b5f49a2153377e7aed54c77d670d6655 Mon Sep 17 00:00:00 2001 From: Fabian Helfer Date: Thu, 5 Feb 2026 14:56:31 +0100 Subject: [PATCH 3/3] [Improvement] Auth: Tab SOAP code-style preferences --- .../Authentication/classes/class.ilObjAuthSettingsGUI.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php index 76a8d17243f0..7d29e2298050 100755 --- a/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php +++ b/components/ILIAS/Authentication/classes/class.ilObjAuthSettingsGUI.php @@ -686,11 +686,13 @@ private function buildSOAPForm( 'defaultrole' => $defaultrole, 'allowlocal' => $allowlocal ]; + if (!$access) { foreach ($inputs as $key => $input) { $inputs[$key] = $input->withDisabled(true); } } + $form = $this->ui_factory->input()->container()->form()->standard( $access ? $submit_action : $show_action, $inputs @@ -699,11 +701,12 @@ private function buildSOAPForm( if (!$access) { $form = $form->withSubmitLabel($this->lng->txt('refresh')); } + return $form; } private function buildSOAPTestForm( - string $submit_action, + string $submit_action ): \ILIAS\UI\Component\Input\Container\Form\Form { $ext_uid = $this->ui_factory->input()->field()->text( 'ext_uid'