Hello All,
I host several coldfusion websites on a server, each requiring CKEditer functionality with CKFinder integrated; I currently have it set it up so that only one copy of CKEditor and CKFinder is required (rather than having each website with its own copy); using the JS CKEditor installation and the Coldfusion CKFinder installation. So, for instance the paths from the root of my server to CKEditor/CKFinder are as such:
rootstuff/ckeditor
rootstuff/ckfinder
and the path two the adminstration sections of two test websites (where the editors are used), as follows:
rootstuff/MySite1/administration/
rootstuff/MySite2/administration/
so that the editor pages in the admin reach back two directories to make use of the CKEditor and CKFinder. This works dandy, but the problem is that with the current setup the administrator of one website would be able to see the uploaded images of all the other websites as well (because its all going in rootstuff/ckfinder/userfiles/images). This is obviously bad. What I would like to happen is for the CKFinder to store each websites images and such in different subdirectories (like rootstuff/ckfinder/MySite1/userfiles/images for example) so that each website administrator sees only his "sandbox" when utilizing the CKFinder. I am having great difficulty, however, figuring out how CKFinder can discern which website (subdirectory) is currently "calling" it.
I gather that I would have to set some kind of session variable in the CKFinder application file based on a session variable in the Websites subdirectory Application file (with the website name or some such) but I am unclear how to do such a thing or if there is a better way. I am also open to using the JS CKFinder install instead of the Coldfusion one if that makes things any easier. Any help or suggestions anyone could offer would be extremely appreciated. Thanks in advance.
I host several coldfusion websites on a server, each requiring CKEditer functionality with CKFinder integrated; I currently have it set it up so that only one copy of CKEditor and CKFinder is required (rather than having each website with its own copy); using the JS CKEditor installation and the Coldfusion CKFinder installation. So, for instance the paths from the root of my server to CKEditor/CKFinder are as such:
rootstuff/ckeditor
rootstuff/ckfinder
and the path two the adminstration sections of two test websites (where the editors are used), as follows:
rootstuff/MySite1/administration/
rootstuff/MySite2/administration/
so that the editor pages in the admin reach back two directories to make use of the CKEditor and CKFinder. This works dandy, but the problem is that with the current setup the administrator of one website would be able to see the uploaded images of all the other websites as well (because its all going in rootstuff/ckfinder/userfiles/images). This is obviously bad. What I would like to happen is for the CKFinder to store each websites images and such in different subdirectories (like rootstuff/ckfinder/MySite1/userfiles/images for example) so that each website administrator sees only his "sandbox" when utilizing the CKFinder. I am having great difficulty, however, figuring out how CKFinder can discern which website (subdirectory) is currently "calling" it.
I gather that I would have to set some kind of session variable in the CKFinder application file based on a session variable in the Websites subdirectory Application file (with the website name or some such) but I am unclear how to do such a thing or if there is a better way. I am also open to using the JS CKFinder install instead of the Coldfusion one if that makes things any easier. Any help or suggestions anyone could offer would be extremely appreciated. Thanks in advance.
Re: Sandboxed Subdirectories (userfiles/mysite1/images etc.)
As per the later posts on this thread: viewtopic.php?f=10&t=7115&start=10 it seems like StartupPath might help me, but I'm not sure where to set that given how I currently call the CKFinder, which is as follows
Re: Sandboxed Subdirectories (userfiles/mysite1/images etc.)
StartupPath is definitely not the right solution for this kind of setup. It simply sets the startup path (the name of a folder that will be expanded by default on the left side, in the folders pane), but both sites would be still working in the same location.
If you'd like to set up a totally different set of folders for both websites, you should set different baseUrl/baseDir variables for each of them.
I have no idea how your website is internally built, but you can do something more or less like this:
- use "id" (e.g. id= MySite1 / MySite2) to set different baseUrl / baseDir in the configuration file (as explained in viewtopic.php?f=10&t=22552)
- in your website, when user logs in, set a special variable using sessions, eg.:
Session["ckfinder_baseUrl"]["MySite1"] = "/home/sites/MySite1/userfiles/"
Session["ckfinder_baseUrl"]["MySite2"] = "/home/sites/MySite2/userfiles/"
Then, in the configuration file, if for example id "MySite1" is passed to the connector, check if Session["ckfinder_baseUrl"]["MySite1"] is set. If yes, assign it to config.baseUrl.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+