Kunena 7.0.5 & Kunena 6.4.11 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.5 [K 7.0.5] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0.

The Kunena team is also pleased to announce the eleventh version of Kunena 6.4, a native Joomla extension for Joomla! 5.0, 5.1, 5.2, 5.3, 5.4 and 6.0.

Question Duplicate warning when user is not authorised to view attachment

More
10 years 7 months ago #169091 by Pinkeltje
When applying this setting:


And same for files, a duplicate warning appears in topic when user is not logged in:


Blue Eagle and Crypis.
A search on language constante shows that
Code:
COM_KUNENA_SHOWIMGFORGUEST_HIDEIMG
is in following files:

/libraries/kunena/bbcode/bbcode.php
/libraries/kunena/attachment/attachment.php


Maybe this helps to track the problem.

To make sure it didn't have anything to do with settings or template, I made a fresh Kunena 4.0.6 install on localhost using Blue Eagle and default Protostar template.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago - 10 years 6 months ago #170629 by juliank92
Hi Pinkeltje,

I don't know why the Kunena team has chosen to display multiple messages? If you would ask me, i should say it should be enough if there is only one notification. (Let's say the blue one, but hey that is my and probably a different kind of logic)

The red colored notifications, where generated when there should be a attached image displayed by the BB tags. So in this case you should be looking in the file /libraries/kunena/bbcode/bbcode.php, there is a method/function there called renderAttachment on line 2212, you could replace it with the following:
Code:
protected function renderAttachment(KunenaAttachment $attachment, $bbcode, $displayImage = true) { $layout = KunenaLayout::factory('BBCode/Attachment') ->set('attachment', $attachment) ->set('canLink', $bbcode->autolink_disable == 0); $config = KunenaConfig::getInstance(); if (!$attachment->exists() || !$attachment->getPath()) { return (string) $layout->setLayout('deleted'); } elseif (!$attachment->isAuthorised() && !$config->showimgforguest) { return null; } elseif (!$attachment->isAuthorised()) { return (string) $layout->setLayout('unauthorised'); } $bbcode->parent->inline_attachments[$attachment->id] = $attachment; if ($displayImage && $attachment->isImage()) { $layout->setLayout('image'); } return (string) $layout; }

Basically i just added a condition, you should get the same the same if you replace the return null within this condition:
Code:
elseif (!$attachment->isAuthorised()) { return (string) $layout->setLayout('unauthorised'); }
(But just to be safe i added a additional condition, since i don't know when the isAutorised method is false ;) )
Last edit: 10 years 6 months ago by juliank92.
The following user(s) said Thank You: Pinkeltje

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #170630 by Pinkeltje

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #170643 by 810
You have reverted the change.

Why we added it, if you have attacht the images inline, you will see the warning message, that a image is hidden. Now you removed the warning message. So the guests don't know that there is a image in the message.

The issue, is that the image is checked 1 by 1. because it can be also a file attachment. That's why we didn't fixed the duplicated messages.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #170646 by juliank92
Thanks for explaining why it is implemented, it could be logical to display the notifications, at the positions where a image should be displayed(to clarify gaps in a post). However sometimes it is not, and if you're looking as a guest at topic's it is just like the forum is tripping.

Yeah, pretty much reverted it. Because if you have forumusers who attach 5 or more images and insert them in the post(straight below each other), it's just looking weird to me(being notified 6 times). So i am assuming that that one notification would be enough for them.

Maybe an idea to create an option in the Kunena back-end where you'll could set to show this notifications?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago - 10 years 6 months ago #170662 by Pinkeltje
As already mentionned in my first post: showing a message is ok, but there is no need to show a duplicate message.
Old situation:


After applying changes made by Juliank92:

Display for logged-in users (in both situations):
Last edit: 10 years 6 months ago by Pinkeltje.

Please Log in or Create an account to join the conversation.

Time to create page: 0.248 seconds