Page 1 of 1

File list shows unpublished and unauthorized files

Posted: 09 Aug 2018, 13:39
by MmartinM
Hi,
there seems to be a bug in the "file list" view. I created a user-module and inserted the following code using the Phoca Download Button:
{phocadownload view=filelist|id=2}
On the frontpage ALL files of the selected category are shown, no matter if they are unpublished or even unauthorized. When I set a single download-file to "unpublished" it is still shown on the frontend.
Am I doing something wrong? What do I have to do to hide unpublished files???
Thanks in advance, martin

Re: File list shows unpublished and unauthorized files

Posted: 12 Aug 2018, 11:03
by Jan
Hi, yes, plugin code does not care about the rights, if you just paste the plugin to the text, this means you just want to display it. The access rights are controlled by the text/article. So if the article should be not displayed, will be not displayed, etc. :idea:

This is done intentionally. For example, you want to display some file in article but you don't want to list it in component. So such file will be not displayed in component (set to unpublished/unauthorized) but will be displayed in article even it is not displayed in component.

Jan

Re: File list shows unpublished and unauthorized files

Posted: 14 Aug 2018, 13:40
by MmartinM
Hi Jan,
thank you for bringing light into the darkness of not-understanding.
I solved this problem (for a customer of mine) by adding the following line in the /plugins/content/phocadownload/phocadownload.php
$query .= ' WHERE a.published = 1 AND a.approved = 1';
Works fine for me.
Best regards, martin

Re: File list shows unpublished and unauthorized files

Posted: 14 Aug 2018, 14:54
by Jan
Ok