Previously we had shown how to make a upload directory for ckfinder dynamic based on a session variable.
http://webglobalnet.net/support/index.php/topic,2497.0.htmlThis works great the problem becomes how to make this in an admin area correctly go to the right directory when working with multiple accounts and records.
This issue is as far as we can make it work dynamically it must be based on a session variable mainly because we haven't figured out how to pass a URL variable to the config.php file in ckfinder
So what we did when viewing a particular record we created the following when editing the record was on the edit.php page (or what ever you call the edit page):
<?php
$customerid=$row_rsads_sba['account_id'];
$_SESSION['cust_id'] = $customerid;
?>
This creates the correct variable that is needed to go to the right client file upload directory.
In the config.php file in ckfinder we then changed the base url as follows:
$baseUrl = '/admin/ckfinder/userfiles/'.$_SESSION['cust_id'].'/';
and the
$baseDir = '/home/
domain/public_html/admin/ckfinder/userfiles/'.$_SESSION['cust_id'].'/';
Change red to your server directory nameand it worked so instead of actually having to login to a clients account we can now work on a clients record in the admin area created.
The .$_SESSION['cust_id'] variable is overwritten for each separate client record you may be looking at each time