I'm using 2.0.0 RC2 on Joomla 1.6 and am having a weird issue:
I have a category and file both restricted to registered users.
I log in and copy the file's download link URL, then logout.
Paste the URL into the browser, hit enter and it prompts me to login, as it should.
Once I login, I am redirected to what appears to be an empty category list and most of the URL is missing.
index.php?option=com_phocadownload&view=category&download=3:members-only-file&id=3:member-files&Itemid=478
becomes
index.php?option=com_phocadownload&view=category&id=:&Itemid=478
Any insight?
Thanks,
Bobby
Phoca Download redirect after login
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Phoca Download redirect after login
Hi, I will take a look at it, the problem is the security is more then the function, it means, the not public file is protected by many features to really not get it so there can be some problem then to display it if some combination will be added to the url bar (possible problem with recognizing if this is an ID of category or ID of file in case the url is not clicked standard way - per urls on the site).
Jan
Jan
If you find Phoca extensions useful, please support the project
-
osiloke
- Phoca Newbie

- Posts: 2
- Joined: 01 Sep 2011, 15:59
Re: Phoca Download redirect after login
Hey the problem occurs on line 124 of the file at \components\com_phocadownload\views\category\view.html.php
here is my quickfix which just uses the return uri (like God intended).
if ($downloadId > 0) {
// $currentLink = 'index.php?option=com_phocadownload&view=category&id='.$this->category[0]->id.':'.$this->category[0]->alias.$tmpl['limitstarturl'] . '&Itemid='. JRequest::getVar('Itemid', 0, '', 'int');
//quick fix to solve redirection problem (by osiloke)
//viewtopic.php?f=31&t=13437
$currentLink = $uri;
$fileData = PhocaDownloadHelperFront::getDownloadData($downloadId, $currentLink);
PhocaDownloadHelperFront::download($fileData, $downloadId, $currentLink);
}
here is my quickfix which just uses the return uri (like God intended).
if ($downloadId > 0) {
// $currentLink = 'index.php?option=com_phocadownload&view=category&id='.$this->category[0]->id.':'.$this->category[0]->alias.$tmpl['limitstarturl'] . '&Itemid='. JRequest::getVar('Itemid', 0, '', 'int');
//quick fix to solve redirection problem (by osiloke)
//viewtopic.php?f=31&t=13437
$currentLink = $uri;
$fileData = PhocaDownloadHelperFront::getDownloadData($downloadId, $currentLink);
PhocaDownloadHelperFront::download($fileData, $downloadId, $currentLink);
}
-
osiloke
- Phoca Newbie

- Posts: 2
- Joined: 01 Sep 2011, 15:59
Re: Phoca Download redirect after login
You might also want to change line 211 in components\com_phocadownload\helpers\phocadownload.php because its a potential problem and it was not fixed in the newer versions. It allows you to redirect the url properly to the right menu item.
$returnUrl = 'index.php?option=com_users&view=login&return='.base64_encode($return);
to
$returnUrl = JRoute::_('index.php?option=com_users&view=login&return='.base64_encode($return));
$returnUrl = 'index.php?option=com_users&view=login&return='.base64_encode($return);
to
$returnUrl = JRoute::_('index.php?option=com_users&view=login&return='.base64_encode($return));
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Phoca Download redirect after login
Hi, thank you for the info.
Jan
Jan
If you find Phoca extensions useful, please support the project