dedecms后台无法登陆,或者后台空白时怎么办
//解决方法:找include/userloginclassphp里面的keepuser()函数,将其修改为以下代码即可
function keepUser(){
if($this->userID != '' && $this->userType != ''){
global $admincachefile,$adminstyle;
if(empty($adminstyle)) $adminstyle = 'dedecms';
if (!isset($_SESSION[$this->keepUserIDTag]))
$_SESSION[$this->keepUserIDTag] = $this->userID;
if (!isset($_SESSION[$this->keepUserTypeTag]))
$_SESSION[$this->keepUserTypeTag] = $this->userType;
if (!isset($_SESSION[$this->keepUserChannelTag]))
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
if (!isset($_SESSION[$this->keepUserNameTag]))
$_SESSION[$this->keepUserNameTag] = $this->userName;
if (!isset($_SESSION[$this->keepUserPurviewTag]))
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
if (!isset($_SESSION[$this->keepAdminStyleTag]))
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
PutCookie('DedeUserID', $this->userID, 3600 24, '/');
PutCookie('DedeLoginTime', time(), 3600 24, '/');
$this->ReWriteAdminChannel();
return 1;
}else{
return -1;
}
}
57版本的bug。
问题原因:
session_register,php54移除了这个函数,版本里说明,继续使用该函数会产生错误。
if (!isset($_SESSION[$this->keepUserTypeTag]))改成这个方式就可以了
解决方法:
找include/userloginclassphp里面的keepuser()函数,
把@session_register 全部改写, 虽然不知道这个@是什么意思
把@session_register($this->keepUserIDTag); 注释掉,然后改为
if (!isset($_SESSION[$this->keepUserIDTag]))
全部有6个。
如下:
if (!isset($_SESSION[$this->keepUserIDTag]))
//@session_register($this->keepUserIDTag);
$_SESSION[$this->keepUserIDTag] = $this->userID;
if (!isset($_SESSION[$this->keepUserTypeTag]))
//@session_register($this->keepUserTypeTag);
$_SESSION[$this->keepUserTypeTag] = $this->userType;
if (!isset($_SESSION[$this->keepUserChannelTag]))
//@session_register($this->keepUserChannelTag);
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
if (!isset($_SESSION[$this->keepUserNameTag]))
//@session_register($this->keepUserNameTag);
$_SESSION[$this->keepUserNameTag] = $this->userName;
if (!isset($_SESSION[$this->keepUserPurviewTag]))
//@session_register($this->keepUserPurviewTag);
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
if (!isset($_SESSION[$this->keepAdminStyleTag]))
//@session_register($this->keepAdminStyleTag);
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
然后就可以登入后台了。
按原理你要想更改数据库密码,先要到你买的空间的更改数据库密码,然后在到DEDECMS data/commonincphp
把数据库密码改成何你空间的数据库密码一样,这样网站才能正常显示。但是问题来了你有没碰到这样改了之后后台进不去,或者打开时空
白页面和不能注销后台呢,只能进/dede/loginphp进入后台呢。我被这问题困扰了几个小时呢。当时真想把网站删除了。在网上找了好久
p 用Dreamweaver 打开把里面主机名称和数据库账号密码改成空间的一样就可以了(记住不要用记事本修改)!
0条评论