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
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 :
if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsownid = "-1"; if (isset($_SESSION['own_id'])) { $colname_rsownid = $_SESSION['own_id']; } mysql_select_db($database_association, $association); $query_rsownid = sprintf("SELECT * FROM associations WHERE assoc_id = %s", GetSQLValueString($colname_rsownid, "int")); $rsownid = mysql_query($query_rsownid, $association) or die(mysql_error()); $row_rsownid = mysql_fetch_assoc($rsownid); $totalRows_rsownid = mysql_num_rows($rsownid);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