Page 1 of 1
Only view his/her uploaded files
Posted: 29 Feb 2016, 22:19
by kaushikndm
Hi,
In order for a user to only view his/her uploaded files (with play, details and download option for these files) on a separate page, what needs to be done?
Any idea as to how this can be achieved?
Thank you
Re: Only view his/her uploaded files
Posted: 01 Mar 2016, 17:46
by Jan
Hi, then the access rights needs to be set for these users. So the file then needs to be set so access rights gets only the user who uploaded this file.
But I don't understand the logic - if some user will upload a file, only he/she can access it? But why to upload it, he/she can access it on his/her computer?
Mostly users upload files, so such can be accessible for other users (public or specific groups or for administrators only)
Jan
Re: Only view his/her uploaded files
Posted: 01 Mar 2016, 20:23
by kaushikndm
Hi,
Thank you for the quick reply. The project that i m working on needs it that way. Basically more like a file(Audio files) storing system online. Would you be able to help me with the files to work or edit to achieve this kind of user access/rights?
Re: Only view his/her uploaded files
Posted: 05 Mar 2016, 19:06
by Jan
Hi, I didn't do such customization yet, so I have no clue advice for this. But in this forum, there were some guides, how to add form input forms to the frontend upload view.
There can be two ways:
1) add form field to frontend user upload view where users will set the right for the files - this is difficult
2) set for every uploaded file the access rights group of the user who upload - directly in the controller or module (files which manage the storing the information to database)
components\com_phocadownload\models\user.php
Add the similar code to this code:
Code: Select all
// Lang
$userLang = PhocaDownloadUser::getUserLang();
$row->language = $userLang['lang'];
Here you can get user language and you store it to the file table.
So you get the access rights of the user and set it for the file table: phocadownload -> access - or you can set it for the category of this file
Jan