Don't know if anyone cares anymore but here is the solution I came up with for CKFinder security. Basically it limits access to the IP address of the logged in admin - it's not perfect but it's pretty good.
I establish the access to CKFinder in #admin#/includes/ckeditor.php but I'm sure this idea could be ported.
In ckeditor.php I added the following:
Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/* BEGIN ADD */
$IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
$currentcode = md5('salt_one' . $IP . 'salt_two');
/* END ADD */
$var = zen_get_languages();
The "salt_one" and "salt_two" are hardcoded random strings.
Then I added the access lines to the CKEDITOR.replace call like so
Code:
CKEDITOR.replace($(this).attr('name'),
{
coreStyles_underline : { element : 'u' },
width : 760,
language: lang[index],
filebrowserBrowseUrl: '../<?php echo DIR_WS_EDITORS ?>ckfinder/ckfinder.html?lcsd=<?php echo $currentcode ?>',
filebrowserImageBrowseUrl: '../<?php echo DIR_WS_EDITORS ?>ckfinder/ckfinder.html?type=Images&lcsd=<?php echo $currentcode ?>',
filebrowserUploadUrl:
'../<?php echo DIR_WS_EDITORS ?>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&lcsd=<?php echo $currentcode ?>',
filebrowserImageUploadUrl:
'../<?php echo DIR_WS_EDITORS ?>ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&lcsd=<?php echo $currentcode ?>'
});
Now I have a parameter being passed to the CKFinder that is unique to the current users IP address (proxies, etc notwithstanding).
Then, over in the /ckfinder/config.php I test for this new parameter:
Code:
function CheckAuthentication()
{
$IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
$currentcode = md5('salt_one' . $IP . 'salt_two');
$testcode = '';
if (isset($_REQUEST['lcsd'])) {
$testcode = $_REQUEST['lcsd'];
};
return ($testcode == $currentcode);
}
Perhaps I'm missing something obvious, but so far it appears to be working.
Tony