I'm trying to set the upload folders dynamically based on a session variable of $_SESSION['own_id'];
I tried this
$assoc_id = $_SESSION['own_id'];
$baseUrl = '/assets/assoc/'.$assoc_id.'/';
and this - $baseUrl = '/assets/assoc/'.$_SESSION['own_id'].'/';
$baseDir = '/home/assoc/public_html/assets/assoc/'.$assoc_id.'/';
& $baseDir = '/home/assoc/public_html/assets/assoc/'.$_SESSION['kt_own_id'].'/';
but for some reason the $_SESSION['own_id'] is not being read - because many users have access to the same area I need to create private upload areas for each user so users see only there own images and not the others.
What I'm try to get is this
$baseUrl = '/assets/assoc/14003';
$baseDir = '/home/assoc/public_html/assets/assoc/14003;
with 14003 being the dynamic value of the folder created on the server
Maybe the question I should be asking is how to pass the $_SESSION['own_id'] into the config.php
Does anyone have an idea how this can be done ?
Thanks
I tried this
$assoc_id = $_SESSION['own_id'];
$baseUrl = '/assets/assoc/'.$assoc_id.'/';
and this - $baseUrl = '/assets/assoc/'.$_SESSION['own_id'].'/';
$baseDir = '/home/assoc/public_html/assets/assoc/'.$assoc_id.'/';
& $baseDir = '/home/assoc/public_html/assets/assoc/'.$_SESSION['kt_own_id'].'/';
but for some reason the $_SESSION['own_id'] is not being read - because many users have access to the same area I need to create private upload areas for each user so users see only there own images and not the others.
What I'm try to get is this
$baseUrl = '/assets/assoc/14003';
$baseDir = '/home/assoc/public_html/assets/assoc/14003;
with 14003 being the dynamic value of the folder created on the server
Maybe the question I should be asking is how to pass the $_SESSION['own_id'] into the config.php
Does anyone have an idea how this can be done ?
Thanks
Re: setting the ckfinder upload directories dynamically
Re: setting the ckfinder upload directories dynamically
Re: setting the ckfinder upload directories dynamically
The search functions on this forum are terrible. Anyways, managed to find it eventually. Hope it helps!
viewtopic.php?f=11&t=19720
Re: setting the ckfinder upload directories dynamically
Thanks for trying though
Re: [SOLVED} setting the ckfinder upload directories dynamic
In the /ckfinder/config.php
First included the connection file on the first line of the page
<?php include("association.php"); ?> For some reason Require Once did not work.
I then created the record set at the beginning of the file using dreamweaver which created the session variable I needed, tip though move the connection file to the ckfinder directory first.
Next I moved all this code that Dreamweaver created :
To just above the $baseUrl setting
Next I set this as follows
$baseUrl = '/assets/assoc/'.$_SESSION['own_id'].'/';
and the $baseDir as follows
$baseDir = '/home/assoc/public_html/assets/assoc/'.$_SESSION['own_id'].'/';
and that was it - but this will not work unless you add this session_start();
here like this at the beginning of the file
<?php include("association.php"); ?>
<?php
session_start();
/*
* ### CKFinder : Configuration File - Basic Instructions