dsljpwi494719 2016-10-27 12:15
浏览 14
已采纳

PHP KCFinder会话安全选项

I have the following CK editor file manager: https://github.com/sunhater/kcfinder My problem is I have one CMS system and would like to secure the browser.php file. If member who not logged in on the site can open the brwser.php and he/she can delete the uploaded images. I have a login system which checks the $_SESSION['userlogin'] is empty or not. So my question is where to add my login session to check if the $_SESSION['userlogin'] is empty or not? I tried take it to the browser.php, but it is not working:

if (empty($_SESSION['userlogin'])) {
    header('Location: http://www.example.com/login');
}

When i try to var_dump($_SESSION) it shows me NULL why?

  • 写回答

1条回答 默认 最新

  • dongzhao1865 2016-10-27 12:54
    关注

    KCFinder already has this feature built into it. In your login procedure, you should set a session variable:

    if($login_successful) {
      $_SESSION['KCFINDER']                 = array();
      $_SESSION['KCFINDER']['disabled']     = false;    
    }
    

    KCFinder should be disabled by default, it's this session variable that enables it. Does this solve it?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 这个复选框什么作用?
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下