Skip to content

Commit 8e7d9a1

Browse files
authored
Fix SOAP authentication: reinitialize user in SOAP context
1 parent d9c871d commit 8e7d9a1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

components/ILIAS/WebServices/SOAP/classes/class.ilAbstractSoapMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function getServiceUse(): string
6161
protected function initIliasAndCheckSession(string $session_id): void
6262
{
6363
$this->initAuth($session_id);
64-
$this->reInitUser();
6564
if (!$this->checkSession($session_id)) {
6665
throw new ilSoapPluginException($this->getMessage());
6766
}

components/ILIAS/soap/classes/class.ilSoapAdministration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ protected function initAuth(string $sid): void
147147

148148
session_id($sid);
149149

150+
ilInitialisation::reInitUser();
151+
150152
if (ilContext::getType() !== ilContext::CONTEXT_SOAP) {
151-
ilInitialisation::reInitUser();
152153
ilUtil::setCookie(session_name(), $sid);
153154
}
154155
}
@@ -162,7 +163,7 @@ protected function initIlias(): void
162163
}
163164
}
164165
}
165-
166+
166167
public function reInitUser(): void
167168
{
168169
if (ilContext::getType() === ilContext::CONTEXT_SOAP) {

components/ILIAS/soap/resources/soap/server.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727

2828
require_once 'vendor/composer/vendor/autoload.php';
2929
require_once __DIR__ . '/../../artifacts/bootstrap_default.php';
30+
31+
ilContext::init(ilContext::CONTEXT_SOAP);
32+
3033
entry_point('ILIAS Legacy Initialisation Adapter');
3134

3235
// Initialize the error_reporting level, until it will be overwritte when ILIAS gets initialized
3336
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
3437

35-
ilContext::init(ilContext::CONTEXT_SOAP);
3638

3739
$ilIliasIniFile = new ilIniFile('./ilias.ini.php');
3840
$ilIliasIniFile->read();

0 commit comments

Comments
 (0)