1

I have ckfinder integrated with my php admin for a site that I am building. As default, it allows all to access the html upload page. I tried following the docs for the authentication in the config.php file but when I check for an existing session or cookie it returns an error. What am I missing?

Read the docs and tried to follow the instructions.

 $config['authentication'] = function() {
     if(isset($_COOKIE['cookie_admin']) || $_SESSION['session_admin']){
         return true;
     } else {
         return false;
     }
 };

I need to block users that are not logged in from using that page.

Guy
  • 11
  • 4

1 Answers1

0

I solved it by adding in the file that checks if the user is logged in this code: $_COOKIE['cookie_admin') = "true";

and false accordingly (and to the session to) and added the line from the ckfinder docs and now it works.

Guy
  • 11
  • 4
  • First of all, session variable like `$_COOKIE['cookie_admin']` needs to be set inside your application when user logs in. If for some reason your `config.php` doesn't read sessions but you know this variable should be available, please try adding `session_start()` at the top of your `config.php` file. Adding `$_COOKIE['cookie_admin') = "true";` inside authentication function is like returning `true` which means no authentication at all. – j.swiderski Aug 08 '19 at 12:30