5

I am quite new to CKFInder, and I received the error

The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.

I had a look on site like the following:

http://ckeditor.com/forums/Support/file-browser-disabled-for-security-reasons.

http://ckeditor.com/forums/Support/File-browser-disabled

http://ckeditor.com/forums/Support/file-browser-disabled-for-security-reasons.

They all mention a function in the config.php file called checkAuthentication(), but I did a search through all the files and cannot fine the function.

All the other people with the same error on the forums use CKFinder 2, and I cannot find another person with the error using v3

I do believe its just something small that I am overlooking.

Thanx in advance

CopperRabbit
  • 646
  • 3
  • 7
  • 24

5 Answers5

6

Returning true for authentication is obviously not secure. Please have a look here to see a few examples presenting how this option can be used.

zaak
  • 745
  • 7
  • 14
  • The user has to be logged in to be able to access CKFinder, but I added `return ($this -> session -> userdata('user_id')) ? true : false;` just to make sure. Each user has their own folder and will only be able to access their own – CopperRabbit May 18 '16 at 06:20
  • the to did not work, because I cannot access CodeIgniter's Sessions, is there a way to pass a PhP variable through to the config.php file. I tried `$GLOBALS['var'] = $var;` but I cannot pich up the variable – CopperRabbit May 18 '16 at 07:52
  • 2
    I managed to get all the correct vars by defining the CodeIgniter session's value to the correct variables in the config.php file at the top of the page before the config setup part starts – CopperRabbit May 24 '16 at 08:38
5

go to ckfinder/config.php

find the following line

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

};

turn false to true here.

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

};

4

After looking through the config.php file, I saw a config item $config['authentication']

After I set this to return true, I don't get the error anymore. But not sure if this is the safest/best way to resolve the matter

CopperRabbit
  • 646
  • 3
  • 7
  • 24
1

Since it's about PHP, nobody said anything about CKFinder for ASP.Net although it's almost the same as CKFinder for PHP, anyway if you are using CKFinder for ASP.Net, and you just downloaded it, you should look up for IsAuthenticated() method, in sample package offered in here, go to App_Code folder then open RoleBasedAuthenticator.cs file, make it return true instead of false temporarily:

private bool IsAuthenticated(string[] roles)
        {
            // Should always fail if matcher is empty.
            if (_allowedRoleMatcherTemplate == string.Empty)
            {
                return true;
            }
...
Muhammad Musavi
  • 2,512
  • 2
  • 22
  • 35
1

Go to ckfinder folder, find config.php file, go to the below line,

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

And make sure it is return true not false.

Hope this helps you.

Bùi Đức Khánh
  • 3,975
  • 6
  • 27
  • 43
Mahesh
  • 11
  • 9