From 7413c31fcbcf5f6bc7f10f2458a562656706f31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Noack?= Date: Mon, 20 Jan 2025 12:31:17 +0000 Subject: =?UTF-8?q?Resolve=20#5145=20"Schnittstelle=20Ilias:=20In=20Ilias?= =?UTF-8?q?=20gel=C3=B6schte=20Nutzer=20f=C3=BChren=20zu=20Inkonsistenz"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #5145 Merge request studip/studip!3844 --- lib/ilias_interface/ConnectedIlias.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ilias_interface/ConnectedIlias.php b/lib/ilias_interface/ConnectedIlias.php index 45f5e3d..aa39801 100644 --- a/lib/ilias_interface/ConnectedIlias.php +++ b/lib/ilias_interface/ConnectedIlias.php @@ -97,6 +97,12 @@ class ConnectedIlias // init current user (only if ILIAS installation is active) if ($this->ilias_config['is_active']) { $this->user = new IliasUser($this->index, $this->ilias_config['version']); + if ($this->user->isConnected()) { + $ilias_user_exists = $this->soap_client->lookupUser($this->user->getUsername()); + if (!$this->soap_client->getError() && !$ilias_user_exists) { + $this->user->unsetConnection(true); + } + } // create account automatically if it doesn't exist if (! $this->user->isConnected()) { $this->soap_client->setCachingStatus(false); @@ -651,9 +657,9 @@ class ConnectedIlias public function getConnectedCoursesForUser(string $user_id): array { $query = 'SELECT module_id, object_id - FROM object_contentmodules + FROM object_contentmodules JOIN seminar_user ON object_contentmodules.object_id = seminar_user.Seminar_id - WHERE seminar_user.user_id = ? + WHERE seminar_user.user_id = ? AND system_type = ? AND module_type = ?'; return DBManager::get()->fetchPairs($query, [ -- cgit v1.0