php5.4环境下DedeCMS登录退出后台空白的解决办法汇总

来源:互联网 发布:淘宝不满意怎么退货 编辑:程序博客网 时间:2024/05/01 06:40
php5.4环境下DedeCMS登录退出后台空白的解决办法汇总


php5.4删除了session_unregister函数,导致织梦系统安全登录退出时,后台出现空白:看了一下安全退出的代码,就明白了:


  1. function exitUser()
  2. {
  3. ClearMyAddon();
  4. @($this->keepUserIDTag);
  5. @session_unregister($this->keepUserTypeTag);
  6. @session_unregister($this->keepUserChannelTag);
  7. @session_unregister($this->keepUserNameTag);
  8. @session_unregister($this->keepUserPurviewTag);
  9. DropCookie('dedeAdmindir');
  10. DropCookie('DedeUserID');
  11. DropCookie('DedeLoginTime');
  12. $_SESSION = array();
  13. }

由此可见 是php版本的问题,因我网站php版本5.4,php5.4删除了session_unregister该函数,而dedecms没有做相应调整,不支持最新版php。


解决办法1:
在include/userlogin.class.php中查找function keepUser(),dedecms教程大概在281行
把keepUser()函数下的@session_register();整段删除

解决方法2:
在include/userlogin.class.php 中声明一个函数
function session_register()
{
return true;
}
织梦仿站系列教程第四讲——首页页首代码
0 0