Skip to content
Snippets Groups Projects
Commit 2f063e32 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

ensure user is valid, fixes #2288

Closes #2288

Merge request studip/studip!1512
parent f88633b1
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -85,6 +85,7 @@ class ForumAbo ...@@ -85,6 +85,7 @@ class ForumAbo
// fetch all users to notify, exclude current user // fetch all users to notify, exclude current user
$stmt = $db->prepare("SELECT DISTINCT user_id $stmt = $db->prepare("SELECT DISTINCT user_id
FROM forum_abo_users FROM forum_abo_users
JOIN auth_user_md5 USING (user_id)
WHERE topic_id IN (:topic_ids) WHERE topic_id IN (:topic_ids)
AND user_id != :user_id"); AND user_id != :user_id");
$stmt->bindValue(':topic_ids', array_keys($path), StudipPDO::PARAM_ARRAY); $stmt->bindValue(':topic_ids', array_keys($path), StudipPDO::PARAM_ARRAY);
...@@ -117,10 +118,12 @@ class ForumAbo ...@@ -117,10 +118,12 @@ class ForumAbo
if ($user->locked || ($expiration > 0 && $expiration < time())) { if ($user->locked || ($expiration > 0 && $expiration < time())) {
$force_email = false; $force_email = false;
} }
$parent_id = ForumEntry::getParentTopicId($topic['topic_id']);
setTempLanguage($data['user_id']); setTempLanguage($data['user_id']);
$notification = sprintf(_("%s hat einen Beitrag geschrieben"), ($topic['anonymous'] ? _('Anonym') : $topic['author'])); $notification = sprintf(
_('%s hat einen Beitrag geschrieben'),
$topic['anonymous'] ? _('Anonym') : $topic['author']
);
restoreLanguage(); restoreLanguage();
PersonalNotifications::add( PersonalNotifications::add(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment