Page 1 of 2

Problem with file groups

Posted: 29 Apr 2022, 18:13
by scrapper
Hi, this is the first time I use Phoca Download Version 4.0.1, I have version 4 of Joomla, I have three groups to match the files to and it works, but if a user is not authorized they receive the message "Please login to download the file" even if you are logged in,
furthermore, the logout button appears instead of the one to return to the categories list.
What can I do? thank you!
https://handmadeinitaly.netsons.org/groups.jpg

Re: Problem with file groups

Posted: 29 Apr 2022, 23:04
by Jan
Hi, yes, if user is logged in but does not have rights to access the files, the system just says that he should log in. If the message is not clear, it can be overriden in Joomla language override function. The message is just general to say, login with right account should be done.

Jan

Re: Problem with file groups

Posted: 30 Apr 2022, 09:34
by scrapper
Thanks, for your explanation, the message is not a problem, I would like the user not to be disconnected but sent back to the categories list, I just don't know how to do it.
https://handmadeinitaly.netsons.org/groups.jpg

Re: Problem with file groups

Posted: 01 May 2022, 22:59
by Jan
Hi, then then the option is to change the output of this part and add the button there directly (but from the screenshot I don't see in which view this message is displayed)

Jan

Re: Problem with file groups

Posted: 02 May 2022, 08:00
by scrapper
The message is displayed after the user clicks on an unauthorized download (because it does not belong to that group)
even if i understand very little about PHP i think i found the solution, i made a small modification to the file located in administrator / components / com_phocadownload / libraries / phocadownload / download / download.php

from line: 487
if ($ type == 1) {
// Unique download link
} else {
if (isset ($ filename [0] -> access)) {
if (! in_array ($ filename [0] -> access, $ user-> getAuthorisedViewLevels ())) {
$ app-> enqueueMessage (Text :: _ ("COM_PHOCADOWNLOAD_PLEASE_LOGIN_DOWNLOAD_FILE"), 'error');
$ app-> redirect (Route :: _ $ return, false));
exit;

it was: $ returnUrl I just deleted Url and it works as I wanted
(in this way the user receives the message that he cannot download that file but without being disconnected)
Thanks!

https://handmadeinitaly.netsons.org/groups2.jpg

Re: Problem with file groups

Posted: 08 May 2022, 23:14
by Jan
Hi, thank you for the info.

Jan

Re: Problem with file groups

Posted: 10 May 2022, 11:52
by scrapper
unfortunately I encountered two other problems, to be sure I installed the version without the above changes, everything is fine with the "register" group (procedure: as any new user would do I access the download menu I choose the category and then click on the file name or on the download button)
https://handmadeinitaly.netsons.org/1.jpg
https://handmadeinitaly.netsons.org/4.jpg

same procedure but user not authorized by error, instead of returning to the file or category, why?
https://handmadeinitaly.netsons.org/2.jpg
https://handmadeinitaly.netsons.org/3.jpg

if you want to try
https://handmadeinitaly.netsons.org/download
user: you
password: Scrapper1 @
user with only registered group

Sorry for the inconvenience but I just don't know what to do

Re: Problem with file groups

Posted: 10 May 2022, 13:57
by Jan
Only to be sure, when you disable SEF, does it work?

Re: Problem with file groups

Posted: 10 May 2022, 15:19
by scrapper
do you mean External Download Link? there is a choice between SELF or BLANK I have the same error both ways

I have activated the Debug of the system and here is the result is of help?
https://handmadeinitaly.netsons.org/5.jpg

Re: Problem with file groups

Posted: 11 May 2022, 18:13
by scrapper
I think I have found the problem
so download group settings give error with my groups
https://handmadeinitaly.netsons.org/6.jpg
how the download group settings work.
https://handmadeinitaly.netsons.org/7.jpg
but could this change create problems with other components?