Search…

X3 Photo Gallery Support Forums

Search…
 
Eightkiller
Experienced
Posts: 116
Joined: 15 Jul 2012, 14:34

Re: Embed photo gallery :drum:

28 Jun 2021, 09:09

I wonder how it integrates in a pre existing website, i'm curious, it might be interesting to manage a gallery inside something like a regular wordpress website, where there is not really good tools to do so in a modern way ??
 
User avatar
mjau-mjau
X3 Wizard
Topic Author
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Embed photo gallery :drum:

28 Jun 2021, 10:44

Eightkiller wrote:I wonder how it integrates in a pre existing website, i'm curious, it might be interesting to manage a gallery inside something like a regular wordpress website, where there is not really good tools to do so in a modern way ??
Well, that is exactly the point of Embed gallery, as it can be used in ANY website, including Wordpress. I already have another user using Embed in Wordpress, and I'll post a link here once I get permission. This also means you wouldn't "manage" the Embed gallery from within WP admin, unless you have some "WP file manager plugin". Embed app (like Files app) simply reads and loads files/images from specified folders. To add Embed to Wordpress, you would simply need to include the JS/CSS files and <div> container element in your WP page content where images would get injected.
 
Eightkiller
Experienced
Posts: 116
Joined: 15 Jul 2012, 14:34

Re: Embed photo gallery :drum:

28 Jun 2021, 13:50

Hy,

I've got trouble trying to set up Embed and FilesApp. I'm trying to install it inside a WordPress website.

I would like to know how I can prevent giving access to anyone to the files, for example. I can't access with the URL to /wp-content/uploads/images, for example (i get 403 errors), /images is the folder I would like to manage with FilesApp, and create galleries inside to incorporate with ember after that.

Yet i'm able to install the index.php of FileApp, directly inside /wp-content, and it gives me access to the whole tree folder under it, but it gives access to anyone, so it's completely unsafe and hackable. 

What should I do to prevent this behavior And be able to :

1 - Install file app only in the /images folder
- Force some kind of login to access to the file manager after that


Actually I have a <div> like this 

Code Select all
Code
<div id="myid" class="myclass embed" data-embed-app="/wp-content/index.php" data-embed-path="/uploads/images/myfolder"></div>
and when rendering the page I get this <div>

Code Select all
Code
<div id="myid" class="myclass embed" data-embed-app="/wp-content/index.php" data-embed-path="/uploads/images/myfolder">Invalid request hash. Please Refresh browser.</div>
I properly added the CSS in the header and the scripts at the bottom of the <body>.

Maybe it's not working properly with Wordpress as it is using Relative Paths ? But I tried putting the whole URL instead in data-embed-app and data-embed-path, and it's not working either.

I'm quite forced to use a folder under the /wp-content/, for now I'm still using the default /wp-content/uploads/"mynewfolder"

I have modified the config file, setting a username/password, but it's not taken into account (I cleared all caches in my hosting, on cloudflare, and in my browser), yet no Login form is showing.

Thanks in advance for your help.

P.S. I did a first workaround like this, I actually added inside the index.php of FilesApp: 
Code Select all
Code
require_once('../wp-load.php');

if( current_user_can('administrator')){

//the code of index.php

}
But the login problem is still here, but at least it prevents people not connected as admin to access the file manager.

I also bought a Licence for FilesApp at 39$, is it the same for Embed (I hope so !) ?


Sorry for all the questions, I posted this message in FilesApp too, u can delete the one in the worst place !
 
User avatar
mjau-mjau
X3 Wizard
Topic Author
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Embed photo gallery :drum:

28 Jun 2021, 14:25

Eightkiller wrote:I would like to know how I can prevent giving access to anyone to the files, for example. I can't access with the URL to /wp-content/uploads/images, for example (i get 403 errors), /images is the folder I would like to manage with FilesApp, and create galleries inside to incorporate with ember after that.
The question is not entirely clear. Is this Files app or Embed? To display files in embed AND files app, the images need to be accessible from the web of course, and I don't know how you have setup your Wordpress. Yes you can password-protect Files app, but that will protect access to the APP, and will not change access to any of your images.

If you want to protect Embed app, you would need to password protect the Wordpress page where you have added Embed
Eightkiller wrote:Yet i'm able to install the index.php of FileApp, directly inside /wp-content, and it gives me access to the whole tree folder under it, but it gives access to anyone, so it's completely unsafe and hackable.
Yes you can add Files app anywhere, and it will allow view access to all files and folders from where it's located. If you are using it strictly for Embed, then why not drop Files app in the root of dir that you want Embed to access? Surely that is not the entire /wp-content dir.

Furthermore, you can add password-protection to Files app. Open the file _files/config/config.php, and you will see many commented out options. You can add username and password. See instructions here:
viewtopic.php?f=67&t=10180

Of course, you can also block access to Files app directly from server using .htaccess. Furthermore, you could also drop Files app index.php in a blocked, protected, hidden folder /something/only/you/know and allow it to work just as an API. Many options, but no need to make things complicated.
Eightkiller wrote:1 - Install file app only in the /images folder
First step here is to drop Files app index.php directly in the /images folder. You only need to put Files app index.php in a folder that contains the files/folders you want to display in Embed app. That would be first thing to do!
Eightkiller wrote:2 - Force some kind of login to access to the file manager after that
See my response above about setting login to Files app from the config.

About Embed licence price, yes it's $39.00 same as File app. For further assistance, perhaps I can help you out tomorrow? It's past midnight here. We can continue here, or maybe easier if we go to chat and deal with it directly. Embed is quite new, documentation is limited, and it does require some messing around, especially in Wordpress.
 
Eightkiller
Experienced
Posts: 116
Joined: 15 Jul 2012, 14:34

Re: Embed photo gallery :drum:

28 Jun 2021, 15:58

Maybe we can continue on chat tommorrow, because I already understood everything you answered, my questions were a bit too messy I guess xD, I can log in tommorrow around 11.00 AM GMT+1 I guess (I'm in Paris).

Thanks for your help !