Email from Phocadownload

Phoca Download - download manager
gn1
Phoca Member
Phoca Member
Posts: 14
Joined: 27 Nov 2012, 17:52

Email from Phocadownload

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

Re: Email from Phocadownload

Post 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
If you find Phoca extensions useful, please support the project
gn1
Phoca Member
Phoca Member
Posts: 14
Joined: 27 Nov 2012, 17:52

Re: Email from Phocadownload

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

Re: Email from Phocadownload

Post by Jan »

Hi, maybe you should somehow make the string safe in $_GET

Jan
If you find Phoca extensions useful, please support the project
gn1
Phoca Member
Phoca Member
Posts: 14
Joined: 27 Nov 2012, 17:52

Re: Email from Phocadownload

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

Re: Email from Phocadownload

Post 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
If you find Phoca extensions useful, please support the project
Post Reply