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?

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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效