Category path outside $_SERVER[DOCUMENT_ROOT]

Phoca Gallery - image gallery extension
sgofferj
Phoca Member
Phoca Member
Posts: 34
Joined: 13 May 2012, 16:46

Category path outside $_SERVER[DOCUMENT_ROOT]

Post by sgofferj »

Hi,

is it somehow possible to use a category path outside of $_SERVER[DOCUMENT_ROOT]?

I am sitting in front of a little challenge. At the moment, I am trying to move my home intranet from a whole bunch of self-written stuff, which partially is 15+ years old and basically unmaintainable, into Joomla.

One issue are the security cameras. I have a few cameras around the house and use motion on my home server to take snapshots and do motion detection, etc. Naturally, I don't want those cams publicly accessible. Motion saves the snapshots to a directory well outside the webserver partition. In my old intranet, I used a helper to access them - showwebcam.php.
I was used so that I could simply use <img src="/showwebcam.php?cam=1"> and the script would check if the acces is from an authorized user and then output the jpeg file. Like this:

Code: Select all

<?php
  session_start();
  include "include/functions.php";
  header ("Content-Type: image/jpeg");
  if (authbitset($ACCESS_SERVICES_WEBCAM)) {
    switch ($cam)
    {
      case 3 :
        $file = file_get_contents("/raid/webcam/webcam-3.jpg");
        break;;
      case 2 :
        $file = file_get_contents("/raid/webcam/webcam-2.jpg");
        break;;
      default :
        $file = file_get_contents("/raid/webcam/webcam-1.jpg");
        break;;
    }
    echo $file;
  }
  else {
    $file = file_get_contents($_SERVER['DOCUMENT_ROOT']."/webcam/unauth.jpg");
    echo $file;
  }
?>
I have tried to somehow migrate my script to Joomla but Joomla is a bit out of my league programming-wise.

So the question is, can I do something like this with Phoca Gallery, i.e. have images in a folder outside the doc root and give access to them based on user groups or auth levels?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category path outside $_SERVER[DOCUMENT_ROOT]

Post by Jan »

Hi, such feature can be found in Phoca Download (but e.g. images can be downloaded from place outside the public html but not displayed) so I think this still you need to customize to fit your needs :-(

Jan
If you find Phoca extensions useful, please support the project
sgofferj
Phoca Member
Phoca Member
Posts: 34
Joined: 13 May 2012, 16:46

Re: Category path outside $_SERVER[DOCUMENT_ROOT]

Post by sgofferj »

So I could basically use PD as a helper and call something like this: <img src="/downloads/category/99-webcam?download=1:frontdoor">?
Post Reply