All questions about EDocman extension

Yeat another question about permissions

  • Krx
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 months ago #132171 by Krx
Hello

Is it possible to set documents to be seen by public but downloadable only for register users?
If yes please explain how.

At the moment if I set category or document to registered, when search with edocman search module is performed
search action on that category doesn't show any document.

Our goal is to set system in that way so that documents from specified category are visible to all visitors,
but downloadable only for registered users.

Thanks
Regards

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

More
4 years 8 months ago #136779 by John Kaminski
Replied by John Kaminski on topic Yeat another question about permissions
I have a similar question. Did you get a reply you can share with me?
John

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

  • Krx
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 8 months ago #136780 by Krx
Replied by Krx on topic Yeat another question about permissions
Hi
No but I've found the solution by myself by overriding Edocman component output with some custom coding. Basically I did this:

I've set Edocman category to public and added this php code in my Component override file
Code:
$user = JFactory::getUser(); $groups = $user->groups; if ($groups[2] || $groups[7] || $groups[8]){ show Edocman component default code - file title and download button }else{ show Edocman file title without download button and custom message which asks user to login or register before downloading } /* 2 - registered users 7 - administrators 8 - super users */

So if visitors are not logged they can see only file titles. And if they are logged in they can download.

Regards

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

Moderators: Mr. Dam