开发者

joomla - registered articles within public category can be accessed by guests

I have a public menu item, which is Category List, so it displays list of articles from a category. The category is public but some articles are just for registered users. When a registered user visits the article, he ends up on an address similiar to this one: http://www.example.com/menu-item-title/19-article-alias.

The problem is when a registered user copies the link to the article and gives it to s开发者_如何转开发omeone unregistered because the unregistered one can access the content. When the link is just http://www.example.com/19-article-alias then it's ok, there is a "unauthorized access" message but changing the link format is not an acceptable solution since someone can figure out, that links like http://www.example.com/menu-item-title/19-article-alias are accessible without login.

PS. I am running Joomla 1.6


I feel like I'm going to have to be a bit vague because I don't have Joomla 1.6 in front of me, and pretty much everything joomla is overcomplicated. Basically, you'll need to determine which controller is fired when the link http://www.example.com/menu-item-title/19-article-alias is fired, and add a condition to the controller when it prints the content of if($user->get('id')).

In 1.5, there was this:

    if ($user->get('id') ||
        ($view == 'category' && JRequest::getVar('layout') != 'blog' && $viewcache == 0) ||
         $view == 'archive' && $viewcache == 0) {
        parent::display(false);
    } else {
        parent::display(true);
    }

In your case, you may need some more tweaking – the conditions under which they can and can't view the article may be more complex.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜