Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-04-22 17:20:44

hornhaver
New member
From: Denmark
Registered: 2007-04-22
Posts: 2

EFM multiuser system not recognizing dynamic value in directory

Hi there
I have a multiuser site, where my users - when logged in - can edit their own website (pages). When a user creates a new site,  a folder of that name is created and permissions set. So far so good.
In config.inc.php I see: "for multiple user systems, set it ( IMCONFIG) dynamically ".

I have the following
$IMConfig['images_dir'] = $_SERVER[DOCUMENT_ROOT]."/webhotel/".$uhpcook."/images";

where $uhpcook is retrieved in the top of config.inc.php  - within ExtendedFileManager folder - from a cookie:
$userdata = $_COOKIE["myweb"];
$pieces = explode("-", $userdata);
$uhpcook=$pieces[0];

the cookie exists and looks like this: myweb
HH
www... ... /homepage/
1536
3088264192
29853023
1171725728
29852957
*
which means, that I should be able to upload and handle images from the HH folder, but all I get is an error:

Invalid base directory: /domains/.... webhotel//images - the HH should be in between webhotel and images but never shows up.

How can I parse the value of $uhpcook, so that I can set the directories dynamically?

I have my site hosted on a UNIX PHP 5 server and safe mode is ON
I use an IE 6+ browser and my users use IE as well due to a company policy.

Greetings from Denmark

Offline

#2 2007-04-23 06:07:16

hornhaver
New member
From: Denmark
Registered: 2007-04-22
Posts: 2

Re: EFM multiuser system not recognizing dynamic value in directory

Finally made it :-)
On the page with the editor (uhpsitename is the name of the users image directory parsed by http or cookie

session_start(); //If not already
$_SESSION['uhpname'] = $uhpsitename; //This strores your variable in the session

and in the ExtendedFileManager config.inc.php

session_start(); //Important, otherwise it won't work

$IMConfig['images_dir'] = $DOCUMENT_ROOT."/webhotel/".$_SESSION['uhpname']."/images";
$IMConfig['images_url'] = "/webhotel/".$_SESSION['uhpname']."/images";

Offline

Board footer

Powered by FluxBB