Page 1 of 1

Email from Phocadownload

Posted: 06 Nov 2014, 18:35
by gn1
As set Phocadownload sends me an email when a file is downloaded. This works perfectly.

However it used to send me an email like this
File "49:denise / ALEX.ZIP" was downloaded where denise is the category.

However it now only sends me
File " ALEX.ZIP" was downloaded without the category.

I am sure there is an easy answer to this and I have changed something by mistake but how can I get the category to show again please?

Many thanks

Re: Email from Phocadownload

Posted: 08 Nov 2014, 22:33
by Jan
Hi, just compare the file you have modified with the original file (e.g. in the installation ZIP) to find the modification :idea:

Jan

Re: Email from Phocadownload

Posted: 09 Nov 2014, 12:34
by gn1
Thanks but I haven't modified any file. I have, though, found a solution.

I changed line 1955 of the phocadownlaod.php to
$messageText = JText::_( 'File') . ' "' .$_GET["id"].'/'.$fileName . '" '.JText::_('was downloaded by'). ' '.$name . $userName.'.';

The $_get["id"} returns the category.

Re: Email from Phocadownload

Posted: 09 Nov 2014, 13:49
by Jan
Hi, maybe you should somehow make the string safe in $_GET

Jan

Re: Email from Phocadownload

Posted: 09 Nov 2014, 17:01
by gn1
Sorry I don't understand, What do you mean by safe?


Thanks but I haven't modified any file. I have, though, found a solution.

I changed line 1955 of the phocadownlaod.php to
$messageText = JText::_( 'File') . ' "' .$_GET["id"].'/'.$fileName . '" '.JText::_('was downloaded by'). ' '.$name . $userName.'.';

The $_get["id"} returns the category.

Re: Email from Phocadownload

Posted: 11 Nov 2014, 19:53
by Jan
Hi, $_GET is raw method how to get id from get request

But you need to protect it against possible attacks

In Joomla! there are different methods do protect the get input.

At least you should use:

$id = (int)$_GET['id'];

so the ID will be always the number and nobody can change it to some unsecure string.

Jan