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.
Re: Assigning baseURL based on CKFinder instance ID
I think the first part may be answered by the latter posts in this thread:
viewtopic.php?t=20914
Re: Assigning baseURL based on CKFinder instance ID
The answer is in the topic you have mentioned, but just to remind:
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:
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Assigning baseURL based on CKFinder instance ID
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!
Re: Assigning baseURL based on CKFinder instance ID
Re: Assigning baseURL based on CKFinder instance ID
Yes I think the path I need is "http://" & #CGI.SERVER_NAME# & 'The path I mentioned above'
but I'm not sure exactly where to set this in the config.
Re: Assigning baseURL based on CKFinder instance ID
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+
Re: Assigning baseURL based on CKFinder instance ID
Re: Assigning baseURL based on CKFinder instance ID
Re: Assigning baseURL based on CKFinder instance ID
how to can i check id passed in all url in case of Config.asp ?
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?