0

Does anyone know how to encrypt the following url holding values for phpThumb implemented in MODX so that it is stil readable to phpThumb extension?

As an example, the url for generated image looks like this:

/assets/components/gallery/connector.php?action=web/phpthumb&src=%2Fassets%2Fgallery%2F2%2Ftest.jpg&w=600

What I would like to achieve is to have this url encrypted so that a user would not be able to edit the image himself. Let's imagine applying watermark to an image using fltr, fltr would be part of the image url which if removed would remove watermark as well.

I have already looked into the Gallery Extra model and know where to look for the url constructor, yet I have no clue to which file the variables of the image url are passed to. This means that I'm able to encrypt the image url but can't figure out where the decrypt function needs to be placed in order for phpThumb to read it correctly By "user" I mean any site visitor without manager access. Any ideas?

jacek_podwysocki
  • 807
  • 10
  • 30
  • The user has access to the manager and you don't want him to edit images in the File Manager? Why not restrict his access using ACLs – okyanet Sep 20 '12 at 08:38
  • No, I guess I didn't make myself clear. The Gallery extra outputs images using phpThumb plugin which among other resizes them and adds watermark. The images URL is outputted in the format as quoted above. This means that any site visitor familiar with web techniques enough, could check the image url, copy it to the new window, remove the fltr variable and therefore would be able to have an image without watermark. He would also be able to change any properties from the url being able to manipulate the image. My goal is to prevent that in any possible way. – jacek_podwysocki Sep 20 '12 at 14:55
  • I'm not really familiar with Gallery, but I thought that it would 'cache' the thumbnails to a generated image with a static file path. For some reason you're just getting the call to the connector which is obviously not good. You'll probably get a better response posting in the MODX forums in the Gallery thread, sorry I can't help more on this! – okyanet Sep 20 '12 at 15:14
  • The images are cached as I can see now, but for some reason a link to the phpThumb script is provided instead of apath to the cached image...Thank you for your time anyway! – jacek_podwysocki Sep 20 '12 at 16:01

1 Answers1

1

Might be a bit late but had the same issue...

Solved by using [[+image_absolute]] as placeholder for the img-tag so "src=[[+image_absolute]]"

VolkaRacho
  • 191
  • 1
  • 2
  • 13