Answer the question
In order to leave comments, you need to log in
How to differentiate user rights on a file like themeforest?
On themeforest, each user has a folder where purchased files are stored. I need something similar. Think so. I need to make a specific user the owner of the file (I do not consider the group). I have a table with users. Means in this table it is necessary to enter system uid of the user and then to change the owner chown($uid, $path_to_file);
Question. Is this approach correct or are there better options? And how can I find out this very system uid when registering a user and write it to the database?
Answer the question
In order to leave comments, you need to log in
This approach is wrong.
The rights of site users will always be inherited from the user on whose behalf the web server is running, and interfering with local Linux users here is critically wrong.
Even if you make a crutch, such as running a web server from ROOT (it is fraught with hacks and fractures), and creating a local user every time, you will not be able to take out such a site on any hosting, because root rights will simply not be given there and it will be impossible to create users.
Restrict file access rights through your site, generate one-time links, create a file/owner table and check against it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question