Uploaded By should be the login name

Phoca Download - download manager
karjol
Phoca Member
Phoca Member
Posts: 11
Joined: 07 Jan 2016, 14:05

Uploaded By should be the login name

Post by karjol »

I have multiple admins for the joomla site. When any admin tries to upload a new file, I want "Uploaded By" should automatically pick the Logged in user id.
Please let me know how to achieve it in phoca download and what all the files needs to be modified
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Uploaded By should be the login name

Post by Jan »

Hi, the user id, who uploads the file is set there. :idea:

Jan
If you find Phoca extensions useful, please support the project
karjol
Phoca Member
Phoca Member
Posts: 11
Joined: 07 Jan 2016, 14:05

Re: Uploaded By should be the login name

Post by karjol »

No, It asks to browse and select the user. Instead of that, I want it to automatically take.
I can get it from Joomla using the below code:

$user =& JFactory::getUser();
$userId = $user->get( 'id' );
echo '<input type="hidden" name="user_id" value="' . $userId . '" />';

But I am not getting how to assign it to Uploaded by field.
karjol
Phoca Member
Phoca Member
Posts: 11
Joined: 07 Jan 2016, 14:05

Re: Uploaded By should be the login name

Post by karjol »

can anybody please help on this
karjol
Phoca Member
Phoca Member
Posts: 11
Joined: 07 Jan 2016, 14:05

Re: Uploaded By should be the login name

Post by karjol »

Hi Jan,

can you please help me on this. Can u tell me which file is used to fetch the user inputs from the new file page and store the data to the database.

I know how to get the user ID now I want to assign it to uploaded by field and store to database'.

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

Re: Uploaded By should be the login name

Post by Jan »

Hi, when you run the upload form, it is stored here:

components\com_phocadownload\views\file\tmpl\default.php

Then it is managed in controller and data is stored in database:

components\com_phocadownload\controllers\user.php
components\com_phocadownload\models\user.php

Jan
If you find Phoca extensions useful, please support the project
Post Reply