Hello All,
I currently have CKEditor (Java version) setup and working with the coldfusion CKFinder; using the following code to instantiate the CKFinder:
I want to have the baseURL and baseDIR changed based on a value that I pass in right here; but I've read that this is a security risk, and that the proper course of action is to "assign a specific instance id to the CKFinder instance" and then, based on that, have a switch statement or some such in ckfinder/config.cfm that sets the proper paths for that ID.
The concept of this makes sense to me but I'm not sure how to implement it. Can someone please show me how to modify the above code to incorporate assigning an instance id, and also how, in the config.cfm, this value is accessed (config.id perhaps?).
Thank you.
I currently have CKEditor (Java version) setup and working with the coldfusion CKFinder; using the following code to instantiate the CKFinder:
<textarea class="ckeditor" cols="80" id="body" name="body" rows="10"><cfoutput>#getInfo.body#</cfoutput></textarea> <script type="text/javascript"> var editor = CKEDITOR.replace( 'body' ); CKFinder.setupCKEditor( editor, '../../ckfinder/' ); //CKFinder is a few directories back </script>
I want to have the baseURL and baseDIR changed based on a value that I pass in right here; but I've read that this is a security risk, and that the proper course of action is to "assign a specific instance id to the CKFinder instance" and then, based on that, have a switch statement or some such in ckfinder/config.cfm that sets the proper paths for that ID.
The concept of this makes sense to me but I'm not sure how to implement it. Can someone please show me how to modify the above code to incorporate assigning an instance id, and also how, in the config.cfm, this value is accessed (config.id perhaps?).
Thank you.

viewtopic.php?t=20914
To connect CKFinder with CKEditor and pass the ID to the connector, you must change the way how you integrate both applications.
In the simplest scenario it may look like that:
CKEDITOR.replace( 'editor1', { filebrowserBrowseUrl: '/ckfinder/ckfinder.html?id=foobar' } );In other words, make sure that to all filebrowserXyzUrls settings you'll add "&id=something" at the end.
Then, in the configuration file (config.cfm), you may do something like:
if (isDefined("URL.id") and URL.id eq "joe") { config.baseUrl = config.baseUrl & 'joe/'; }Alternatively, instead of hardcoded "joe" you may use something like
if (isDefined("URL.id") and URL.id eq "joe") { config.baseUrl = config.baseUrl & Session["homedir"]; }if sessions are enabled, and Session["homedir"] is set.
Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
I have everything uploading where they're supposed to go now, and everything looks good when I'm browsing the images. When I actually select one to put into the editor, however, it shows a broken image because the path is relative and not quite right. Here is my setup:
The CKEditer and CKFinder are located here:
var/www/ckeditor/
var/www/ckfinder/
The page that is currently instantiating the editors are here:
var/www/MySite1/admin/somepage.cfm
and the place the files are being deposited is here:
var/www/MySite1/assets_ck/images
And finally, the link that its pointing to when I actually select an image and go back into the editor is:
MySite1/assets_ck/images/testImage.png
This shows a broken image, but its close to the correct url. Furthermore, if this is a relative link like this; it can never show up properly in the editor (which is in an admin subfolder: MySite1/admin) and the front end site (MySite1).
I figure I can hardcode the beginning of the full path or somesuch, but as the domain name might change (testing server to the production server, for example), I'd rather not do that. Is there a way build this url on the spot through some kind of domain name discovery or some such? Sorry if any of this is silly, I'm somewhat new to this sort of thing. Thanks!
but I'm not sure exactly where to set this in the config.
So, in short, config.baseUrl must be corrected.
Let's say that "/MySite1/assets_ck/images/testImage.png" is the correct URL that you would like to have returned from CKFinder.
To achieve this, you should set:
config.baseUrl to "/MySite1/assets_ck/"
config.baseDir to "/var/www/MySite1/assets_ck/" (or something like that, just make sure it's an absolute path)
Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
This is exactly what I have; but the image url it puts in the editor is not correct. For example here is one:
MySite1/assets_ck/images/myImage.png
but, since the page the editor is residing in is
_http://www.mydomain.com/MySite1/admin/editStuff.cfm
that url I am getting is wrong (as it resolves to _http://www.mydomain.com/MySite1/admin/MySite1/assets_ck/images/myImage.png instead of what we want which is _http://www.mydomain.com/MySite1/assets_ck/images/myImage.png
Note: i put underscores in front of the url's here to avoid formatting issues
what are the other querystring parameters i can pass in all url and retrive its values in config.asp?
can you please help me here?