baijianpeng VIP
Total posts: 239
17 Март 2016 04:49

I am running Emerald 9.392, the latest version along with Kunena 4.0.10 on Joomla 3.4.8.

Today I tried to create a new rule to resitrict access to my Kunena forum.

My purpose is: allow paid member to anything (read, reply, submit new topic), but guest and free members can ONLY see category list and topic list, they can not read the content/message of topics in specified categories.

Well, after I save this new rule, I tested as a guest user (log out my website frontend then visit), I noticed that as a guest/public user, I can not even enter the board index (forum category list) page! If I click on the "forum" menu item on the main navigation menu, which was linked to ONLY the category list of whole forum, Emerald blocked me and redirect me to the plans list.

You can see that this is wrong. Emerald should allow ANYONE to see the category list, it should only block those who want to read the fulltext content of topics in certain categories.

Please fix this bug.

Thank you.

Последние изменения: 30 Март 2016


baijianpeng VIP
Total posts: 239
17 Март 2016 10:21

It seems that if Kunena "topic read" restriction rule was set up, then the guest user can not see "latest topic" list either.

I checked the URL of "latest topics" page, it contains:

view=topics

And the topic fulltext page URL contains:

view=topic

Maybe, your rule detects "view=topic" to restrict access to post content page, but this will affect URLs containing "view=topics".

So, you should exclude "view=topics" from "view=topic" rule.

Thank you.


Sergey
Total posts: 13,748
23 Март 2016 08:39

May be Kunena changed URLs. It used to be view category for list of the topics. Drop me latest Kunena here and I'll make some tests.


baijianpeng VIP
Total posts: 239
23 Март 2016 09:39

You are right, for a certain category, the topics list page is :

option=com_kunena&view=category&catid=17&Itemid=154

You can see that it uses "view=category".

However, you know that Kunena has a top menu item titled "Recent topics", this view will show recent topics from ALL categories. The URL for this page is:

option=com_kunena&view=topics&layout=default&mode=replies&Itemid=156

You can see that this page uses "view=topics".

(Maybe they should use view=recent to avoid such a conflict).

You can download the latest Kunena component from:

https://www.kunena.org/download

Or direct link:

https://github.com/Kunena/Kunena-Forum/releases/download/4.0.10/pkg_kunena_v4.0.10_2016-02-18.zip

Hope you will find a way to solve this.

(Maybe you can consider to persuade Kunena team to use view=recent for that page?).

Thank you.


Sergey
Total posts: 13,748
23 Март 2016 14:39

What is your second parameter Allow topics list access Yes or NO?


baijianpeng VIP
Total posts: 239
27 Март 2016 14:03

Of course that option "Allow topics list access" is "Yes", because I want them to see the topic list, but not able to see topic content.

I think the only reason of this issue is: When the script search for "view=topic" in URLs, it will not exclude those with "view=topics", and in fact, a URL with "view=topics" is NOT a topic content page, but a topic list page.

Thank you.


Sergey
Total posts: 13,748
30 Март 2016 12:07

The code that check the rule is simple

if($this->params->get('cats'))
{
    switch($this->input->getCmd('view'))
    {
        case 'topics':
        case 'category':
            if(!$this->params->get('inlist') && in_array($this->input->getInt('catid'), $this->params->get('cats')))
            {
                return TRUE;
            }
            break;
        case 'topic':
            if(!(in_array($this->input->getCmd('layout'),
                    array(
                         'create', 'edit'
                    ))) &&
                in_array($this->input->getInt('catid'), $this->params->get('cats'))
            )
            {
                return TRUE;
            }
            break;
    }
}

I have just added case 'topics':.

Basicaly it works like this. You can see everything axcept

  • If you selected categories and view is category and Allow topics list access is NO can this is one of the selected categories
  • If you selected categories and view is topc and this topic is in the selected category

baijianpeng When the script search for "view=topic" in URLs, it will not exclude those with "view=topics", and in fact, a URL with "view=topics" is NOT a topic content page, but a topic list page.

I cannot get it. Actualy all "view=topics" should be accessible. Because it is not restricted anyhow. And since you have "Allow topics list access" is "Yes", then it should work as expected.

Работает на Cobalt