Keyword

Registred content AND public content display in same publico

  • STEPHAN HERBY
  • STEPHAN HERBY's Avatar Topic Author
  • Offline
  • Premium Member
More
9 years 5 days ago #147733 by STEPHAN HERBY
Hi,
I have a K2 installed with 2 categories :
Category A - For public
Category B - For registred users

If I create a K2ContentModule to display both categories, Cat B items will be shown only if user is registred AND connected.
I need to have both categories display even if user is public, even if he clic on a title and the loggin page will be display...

Is that something possible ?

Thanks for any suggestion...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 days ago #147738 by Krikor Boghossian
Replied by Krikor Boghossian on topic Registred content AND public content display in same publico
Hmm you could manually restrict the access in the template.
By bypassing Joomla!'s ACL you are able to show these items everywhere and perform the user group check directly in the item.php file.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • STEPHAN HERBY
  • STEPHAN HERBY's Avatar Topic Author
  • Offline
  • Premium Member
More
8 years 8 months ago - 8 years 8 months ago #150962 by STEPHAN HERBY
OK, here I am 4 months later with that problem...
The only solution I found for this is to hack the helper.php file in modules > mod_k2_content
I took the line 121 (K2 V 2.6.9) :
$query .= " WHERE i.published = 1 AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).") AND i.trash = 0 AND c.published = 1 AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).")  AND c.trash = 0";
and wrote it in :
$query .= " WHERE i.published = 1 AND i.trash = 0 AND c.published = 1 AND c.trash = 0";

That's now working for me.
I know that this is NOT an override, so I have the be careful with an update. But I also know that the next version will probably be brand V3.0 ok K2, so... :¬p

What I wonder is:
is my website still secure after that hack?
Any advice will be welcome... Tks in advance.
Last edit: 8 years 8 months ago by STEPHAN HERBY.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 8 months ago #150978 by Krikor Boghossian
Replied by Krikor Boghossian on topic Registred content AND public content display in same publico
You already have the code posted here as a backup so you will be ok.
There will 2.7 as well for existing sites in Joomla! 1.5 and 2.5 and the ones using too many 3rd party extensions.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum