diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-16 14:36:19 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-16 14:36:19 +0100 |
| commit | 271013c0e6c36506acad35c4bedeeceb36f7c885 (patch) | |
| tree | 494a41f95a01d5315d8b87325c5652d7d4d63ea4 /lib | |
| parent | b58142fe5fa1ba1a99d850baa1465df6fa6e0d3b (diff) | |
prevent php8 warning, fixes #6166
Closes #6166
Merge request studip/studip!4672
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/classes/Seminar_Perm.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/classes/Seminar_Perm.php b/lib/classes/Seminar_Perm.php index e56835f..63671ec 100644 --- a/lib/classes/Seminar_Perm.php +++ b/lib/classes/Seminar_Perm.php @@ -73,9 +73,9 @@ class Seminar_Perm { global $user; if (!$user_id) { - $user_id = $user->id; + $user_id = $user->id ?? null; } - if ($user_id && $user_id == $user->id) { + if ($user_id && $user && $user_id == $user->id) { return $user->perms; } if ($user_id && isset($this->studip_perms['studip'][$user_id])) { @@ -83,10 +83,7 @@ class Seminar_Perm } if ($user_id && $user_id !== 'nobody') { $query = "SELECT perms FROM auth_user_md5 WHERE user_id = :user_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':user_id', $user_id); - $statement->execute(); - $perms = $statement->fetchColumn(); + $perms = DBManager::get()->fetchColumn($query, [':user_id' => $user_id]); return $this->studip_perms['studip'][$user_id] = $perms; } |
