Skip to content

Commit

Permalink
Minor fix to sending personal messages
Browse files Browse the repository at this point in the history
 personal messages outside of threads, only to members who are not deactivated
  • Loading branch information
Tomatenmarc22 committed Jun 7, 2023
1 parent 8f7392c commit a1664f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Controller/ForumController.php
Expand Up @@ -151,10 +151,20 @@ public function personalMessageAction(Request $request, string $language, string
if (!$forumModule || $forumModule === 'null') {
$session = $request->getSession();
$forumModule = $session->get('pm-forum-module');
}
if (!empty($sRecipient)) {
$db = \Database::getInstance();
$stmt = $db->prepare("SELECT * FROM tl_member WHERE username = ? AND NOT disable = ?");
$result = $stmt->execute($sRecipient, 1);
$aRecipient = $result->fetchAssoc();
if (empty($aRecipient)) {
throw new \Exception($GLOBALS['TL_LANG']['tl_c4g_forum_pn']['member_not_found']);
}
$iRecipientId = $aRecipient['id'];
} elseif (!empty($iRecipientId)) {
$db = \Database::getInstance();
$stmt = $db->prepare("SELECT * FROM tl_member WHERE id = ? AND NOT disable = ?");
$result = $stmt->execute($iRecipientId,1);
$result = $stmt->execute($iRecipientId, 1);
$aRecipient = $result->fetchAssoc();
if (empty($aRecipient)) {
throw new \Exception($GLOBALS['TL_LANG']['tl_c4g_forum_pn']['member_not_found']);
Expand Down

0 comments on commit a1664f1

Please sign in to comment.