Kunena 7.0.9 & Kunena 6.4.14 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.9 [K 7.0.9] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x./6.1.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

Solved Blue Eagle is always subscribing users to topic

More
10 years 3 months ago - 10 years 3 months ago #175930 by TomasFC
Hi,

When I upgraded to Kunena 4.0.11 I noticed that users were automatically being subscribed to a topic when they replied. The configuration settings were unchanged in the upgrade (as it should) remaining as:
Code:
"subscriptionschecked":"0",

Yet the checkbox would show up checked when replying to a topic that the user was NOT subscribed to.

This to me generates an unnecessary volume of emails that I don't want.

I looked through the code and found the solution (I think, at least so far so good).

In the file
components/com_kunena/template/blue_eagle/html/topic/edit.php

Line 176

Reads:
Code:
<input style="float: left; margin-right: 10px;" type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1 && $this->me->canSubscribe != 0 || $this->subscriptionschecked == 0 && $this->me->canSubscribe == 1)

When it should read:
Code:
<input style="float: left; margin-right: 10px;" type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1 && $this->me->canSubscribe != 0 || $this->subscriptionschecked == 1 && $this->me->canSubscribe == 1)

The issue being:
Code:
subscriptionschecked == 0

What this is saying is that if user is NOT subscribed and can subscribe, then check the box/subscribe them.

When it should be saying is that if user IS subscribed and can subscribe, then check the box/subscribe them.

If they are not subscribed the check box should be unchecked, allowing them to check it if they please, but by default should be unchecked.

So I've changed that 0 to a 1, and it seems to work fine. I don't know if there are other places where this should be changed as well.

Please let me know if there are any issues with this.

Thank you, hope this helps,
Tomás

This message contains confidential information

Database collation check: The collation of your table fields are correct

Joomla! SEF: Enabled | Joomla! SEF rewrite: Disabled | FTP layer: Disabled |

This message contains confidential information
htaccess: Exists | PHP environment: Max execution time: 30 seconds | Max execution memory: 64M | Max file upload: 4M

Kunena menu details:

Warning: Spoiler!

Joomla default template details : rt_clarion_responsive | author: RocketTheme, LLC | version: 1.8 | creationdate: October 8, 2014

Kunena default template details : Blue Eagle | author: Kunena Team | version: 4.0.11 | creationdate: 2016-06-05

Kunena version detailed: Kunena 4.0.11 | 2016-06-05 [ Barcelona ]
| Kunena detailed configuration:

Warning: Spoiler!
| Kunena integration settings:
Warning: Spoiler!
| Joomla! detailed language files installed:
Warning: Spoiler!

Third-party components: CommunityBuilder 2.0.14 | UddeIM 3.9

Third-party SEF components: None

Plugins: None

Modules: None

Last edit: 10 years 3 months ago by TomasFC.

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

More
10 years 3 months ago #175933 by sozzled

TomasFC wrote: When I upgraded to Kunena 4.0.11 ...

May I ask you, what version of Kunena were you using before you observed this problem? The problems you refer to commenced in K 4.0.5 and we discussed them >>> here <<<

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

More
10 years 3 months ago - 10 years 3 months ago #175934 by TomasFC
I was on version 4.0.3.

I did not see that thread, even when I searched... :blink:

This is what that same file had (Lines 167 to 177):
Code:
<?php if ($this->canSubscribe()) : ?> <tr id="kpost-subscribe" class="krow<?php echo 1 + $this->k^=1;?>"> <td class="kcol-first"> <strong><?php echo JText::_('COM_KUNENA_POST_SUBSCRIBE'); ?></strong> </td> <td class="kcol-mid"> <input type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1) echo 'checked="checked"' ?> /> <label for="subscribeMe"><i><?php echo JText::_('COM_KUNENA_POST_NOTIFIED'); ?></i></label> </td> </tr> <?php endif; ?>

In re-reading the code, I see that there is a redundancy after my alteration. I'm not sure the statement after the OR ( || ) is needed, even if the values could be -1, 0 or 1.

Tomás
Last edit: 10 years 3 months ago by TomasFC.

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

More
10 years 3 months ago #175935 by 810
No the code is right.

your setting is: subscriptionschecked = 0 (the checkbox is not selected by default)

So we look at the second param:
Code:
$this->subscriptionschecked == 0 && $this->me->canSubscribe == 1

We can skip the first part, we know that the setting is "0".

Now we come on the user setting.

If the user has enable the option "Select subscription as default" on profile->edit->Forum settings

there you can have 3 options:

1) default = -1
2) Off = 0
3) On = 1

there we see $this->me->canSubscribe == 1, so only if you have turned it on, the box is selected.


So you need to tell your users to change their setting, or you resetting all users their setting, but know that if you change it, nobody get any notifications anymore

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

More
10 years 3 months ago #175938 by TomasFC
Sorry, but it's wrong.

The statement is saying that if the subscriptionschecked is 0 then default subscribe the user when he replies to the topic.

And as I understand it, that is the whole point of the "subscriptionchecked" If I set it in the configuration file to 0, I understand it to mean that the default option of the checkbox will NOT be checked. and if it is 1 then, the default check box will be checked.

The code as you wrote it would not allow me to have that box unchecked.

The -1 comes in for the "undecided" users as I see it. If they are undecided on that subscription and the subscriptionschecked is 1, then they will default to checked, but if they have already unsubscribed (0) then it will not show checked as default, even with the subscriptionschecked=1.

Now having seen that, as I said above my change created a redundancy.

Tomás

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

More
10 years 3 months ago #175939 by 810
Half true, the "subscriptionchecked" is the default option for "New" users.

Users are in control if they want to get notifications, not the website owner.

If a user want to change this option, then they can do it on their profile setting.


If you want to disable the option, then you need to do a sql query that set the option to -1 or 0.

Then hide the option by css.

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

Time to create page: 0.255 seconds