Чтобы подружить ckfinder+kohana, как вариант, в начале конфига ckfinder config.php
подключить все те файлы, с которыми работает фреймворк kohana, т.е. фактически продублировать index.php:
$pathToKohanaBaseDirectory = __DIR__ . '/../../..'; // where kohana index.php situated
$application = 'application';
$modules = 'modules';
$system = 'system';
define('EXT', '.php');
define('DOCROOT', $pathToKohanaBaseDirectory . DIRECTORY_SEPARATOR);
if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
$application = DOCROOT.$application;
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
$modules = DOCROOT.$modules;
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
$system = DOCROOT.$system;
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
// Clean up the configuration vars
unset($application, $modules, $system);
require APPPATH.'bootstrap'.EXT;
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*
* @return boolean
*/
function CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
return Auth::instance()->logged_in();
}
В данном случае в функции CheckAuthentication()
мы разрешаем загрузку картинок всем авторизованным пользователям, используется штатная "кохановская" проверка на авторизованность Auth::instance()->logged_in()
.