Problem with file groups

Phoca Download - download manager
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Problem with file groups

Post 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

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem with file groups

Post 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
If you find Phoca extensions useful, please support the project
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Re: Problem with file groups

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem with file groups

Post 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
If you find Phoca extensions useful, please support the project
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Re: Problem with file groups

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem with file groups

Post by Jan »

Hi, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Re: Problem with file groups

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem with file groups

Post by Jan »

Only to be sure, when you disable SEF, does it work?
If you find Phoca extensions useful, please support the project
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Re: Problem with file groups

Post 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
scrapper
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 29 Apr 2022, 14:09

Re: Problem with file groups

Post 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?
Post Reply