【问题标题】:CKFinder 3 - The file browser is disabled for security reasonsCKFinder 3 - 出于安全原因禁用文件浏览器
【发布时间】:2016-05-17 14:03:08
【问题描述】:

我对 CKFInder 很陌生,我收到了错误

出于安全原因,文件浏览器被禁用。请联系您的系统管理员并检查 CKFinder 配置文件。

我在网站上看过如下:

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.

他们都在config.php文件中提到了一个名为checkAuthentication()的函数,但我搜索了所有文件并无法找到该函数。

论坛上出现相同错误的所有其他人都使用 CKFinder 2,而我无法使用 v3 找到另一个出现错误的人

我确实相信它只是我忽略的一些小东西。

提前感谢

【问题讨论】:

    标签: php ckfinder


    【解决方案1】:

    authentication 返回true 显然是不安全的。请查看here 以查看展示如何使用此选项的几个示例。

    【讨论】:

    • 用户必须登录才能访问 CKFinder,但我添加了return ($this -> session -> userdata('user_id')) ? true : false; 只是为了确保。每个用户都有自己的文件夹,并且只能访问自己的文件夹
    • to 不起作用,因为我无法访问 CodeIgniter 的会话,有没有办法将 PhP 变量传递给 config.php 文件。我试过$GLOBALS['var'] = $var;,但我无法获取变量
    • 在配置设置部分开始之前,通过将 CodeIgniter 会话的值定义为页面顶部 config.php 文件中的正确变量,我设法获得了所有正确的变量
    【解决方案2】:

    转到ckfinder/config.php

    找到下面一行

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

    };

    在此处将 false 变为 true。

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

    };

    【讨论】:

      【解决方案3】:

      看了一遍config.php文件,看到了一个配置项$config['authentication']

      将其设置为return true 后,我不再收到错误消息。 但不确定这是否是解决问题的最安全/最好的方法

      【讨论】:

      • 不适合我。如果有其他方法请与我们分享。
      • 是哪个config.php?是\ckfinder\config.php 的形式吗?
      • 没错,这对我有用,但在安全性方面留下了空白
      • 可能是我当时是一些与浏览器缓存相关的问题,第二天它也对我有用。谢谢。
      【解决方案4】:

      进入ckfinder文件夹,找到config.php文件,进入下面一行,

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

      并确保返回 true 而不是 false

      希望对你有所帮助。

      【讨论】:

        【解决方案5】:

        由于是关于 PHP 的,所以没有人提到 CKFinder for ASP.Net 虽然它与 CKFinder for PHP 几乎相同,但无论如何如果你使用 CKFinder for ASP.Net,并且你刚刚下载了它,你应该查找@ 987654322@方法,在here提供的示例包中,进入App_Code文件夹然后打开RoleBasedAuthenticator.cs文件,使其暂时返回true而不是false:

        private bool IsAuthenticated(string[] roles)
                {
                    // Should always fail if matcher is empty.
                    if (_allowedRoleMatcherTemplate == string.Empty)
                    {
                        return true;
                    }
        ...
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-06-30
          • 2016-02-07
          • 2019-11-27
          • 2014-03-31
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多