Search…

X3 Photo Gallery Support Forums

Search…
 
sp0
Topic Author
Posts: 11
Joined: 14 Feb 2021, 14:23

Protecting individual folders

20 Feb 2021, 07:01

I can't find this in documentation or forum so apologies if I've missed something basic.

I'd like to place files.app onto my X3 photo gallery website so clients can collect finished work -- but I need to protect each top level directory so clients can't see each other's work.  

As far as I can see files.app provides user authentication for all, or nothing, in its directory tree.

How do we protect directories with different logins for each?  Create a page on the main gallery for each client using the main photo gallery's protection, and put files.app into each?  Or have one file storage area and somehow protect each directory within it?  Or one file storage area with a separate instance of files.app in each directory below?

Thanks
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Protecting individual folders

20 Feb 2021, 11:28

First of all, there is a logical explanation why this feature does not exist in Files app (at least for now). Files app is a single-file "passive" app that simply reads your files and folders, and doesn't save data in your folders or add .htaccess files into your folders to protect them. Files app has password protection, but that's simply to protect access to itself ... it does not know (or care) about what goes on within your folders, as that is currently your own responsibility. If we wanted to password-protect folders, Files app would no longer be "passive", as it would need to store some data file in each folder to intruct Files app that a folder is password-protected.
sp0 wrote:I'd like to place files.app onto my X3 photo gallery website so clients can collect finished work -- but I need to protect each top level directory so clients can't see each other's work.
Can't you just drop Files app "index.php" into each dir that you want to assign to each customer? That is one of the points of keeping Files app a single-file.

As long as you install Files app into a dir that contains multiple folders, you are essentially exposing all subfolders to files app. In the future, I believe we will have an extended USER-system, where you can assign a specific sub-directory for each user. Assume that would be what you are looking for?
sp0 wrote:How do we protect directories with different logins for each?  Create a page on the main gallery for each client using the main photo gallery's protection, and put files.app into each?  Or have one file storage area and somehow protect each directory within it?  Or one file storage area with a separate instance of files.app in each directory below?
Perhaps in the future you can use a single instance of Files app to manage multiple users restricted to multiple dirs. For now, the simplest option is to drop a Files app "index.php" into each dir where you want to give a client access. This can optionally be password-protected.

You could also for example create a user-dir (outside of X3) like /client-name/, drop Files app index.php inside, and then in the Files app config, simply point it to the dir in X3 you want to target. It doesn't really solve the question of course.

Out of interest, what benefit does Files app provide that X3 does not offer? I mean, since you are adding the files via X3 in the first place, I assume you are creating X3 gallery pages?
 
sp0
Topic Author
Posts: 11
Joined: 14 Feb 2021, 14:23

Re: Protecting individual folders

20 Feb 2021, 11:38

mjau-mjau wrote: Out of interest, what benefit does Files app provide that X3 does not offer? I mean, since you are adding the files via X3 in the first place, I assume you are creating X3 gallery pages?
Thanks for the advice.

The use case is: 
- X3 is my "showcase" gallery for public viewing.  No downloading, sales, etc. and individual client work does not go in there.
- sometimes after a client session I'll make a set of finished photos available for them to download (all or some of)
- I also sometimes give clients other things to collect which aren't photos.

I guess I could just create a bespoke gallery in X3, hidden and password-protected and they could download from there.  Maybe that is better?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Protecting individual folders

20 Feb 2021, 23:20

sp0 wrote:- X3 is my "showcase" gallery for public viewing.  No downloading, sales, etc. and individual client work does not go in there.
Makes sense.
sp0 wrote:- sometimes after a client session I'll make a set of finished photos available for them to download (all or some of)
- I also sometimes give clients other things to collect which aren't photos.
But in this case, would it not be better to keep Files app and X3 entirely separate? You would perhaps have temporary duplicate galleries, but it would be a cleaner approach, especially if you are uploading different sizes and other files.
sp0 wrote:I guess I could just create a bespoke gallery in X3, hidden and password-protected and they could download from there.  Maybe that is better?
Files app is probably better for this purpose, as it's lightweight and more useful for viewing, downloading and filtering without being obscurred by unnecessary "presentation". I believe Files app could do with a few more features to make it perfect for your usage: 1) multi-download selected images, 2) multi-user access, with users restricted to specific folders.

Until then, I can't say what's best. You could use X3 as you suggest, although I would personally prefer Files app for client-specific access. In the case of using Files app, you would probably setup a hidden dir /clients/, which each client dir inside /clients/client_name/. Then drop Files app index.php inside ... Then you can either 1) Drop the files directly in teh client dir, or 2) Set the "content" option to point to the X3 dir that contains the images you want to make available.