Failed to configure ckfinder using ckeditor

I am trying to integrate ckfinder with ckeditor. Everything is in order, except for one. when I try to upload an image, I get this error (please check the image)

Unable to configure ckfinder with ckeditor

This says, β€œThe file browser is disabled for security reasons. Contact your system administrator and check the CKFinder configuration file”

Who can help me? You are welcome.

+6
source share
2 answers

Look in the ckFinder config file, you will see such a function:

 function CheckAuthentication() { return false; } 

By default, CheckAuthentication() is disabled for security reasons, because it will allow any user to upload files to your server.

For testing purposes, you can return true , but the fact is that you implement some logic only for authorization of an authorized user.

 function CheckAuthentication() { //put some logic here return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized']; } 
+7
source

A simple solution is to force the authentication method to use a function that always returns true using the following code in your configuration file.

Your Script (for codeigniter):

 if(login()){ set_cookie('ckf_role','admin',2592000*10); // 10 month } 

Top:

  $config['authentication'] = function() { return true; }; 

Middle:

  session_start(); $config['roleSessionVar'] = 'CKFinder_UserRole'; $_SESSION['CKFinder_UserRole'] = !empty($_COOKIE['ckf_role']) ? strtolower($_COOKIE['ckf_role']) : "guest"; $config['accessControl'][] = array( 'role' => 'guest', 'resourceType' => '*', 'folder' => '/', 'FOLDER_VIEW' => false, 'FOLDER_CREATE' => false, 'FOLDER_RENAME' => false, 'FOLDER_DELETE' => false, 'FILE_VIEW' => false, 'FILE_UPLOAD' => false, 'FILE_RENAME' => false, 'FILE_DELETE' => false, 'IMAGE_RESIZE' => false, 'IMAGE_RESIZE_CUSTOM' => false ); $config['accessControl'][] = array( 'role' => 'admin', 'resourceType' => '*', 'folder' => '/', 'FOLDER_VIEW' => true, 'FOLDER_CREATE' => true, 'FOLDER_RENAME' => true, 'FOLDER_DELETE' => true, 'FILE_VIEW' => true, 'FILE_UPLOAD' => true, 'FILE_RENAME' => true, 'FILE_DELETE' => true, 'IMAGE_RESIZE' => true, 'IMAGE_RESIZE_CUSTOM' => true ); 
0
source

All Articles