dede后台去掉验证码还是不能登录
删除以下几行即可:
If int(CheckCode)<>int(Session("RndNum")) Then
ResponseWrite("<script language=javascript>alert('请输入正确的认证码!');thislocationhref='adminasp';</script>")
ResponseEnd
end if
if RequestForm("CheckCode")<>RequestCookies("CheckCode") then
Responsewrite "<script>alert('验证码错误,登录失败');historyback();</script>"
Responseend
end if
删掉这些就可以了,最好也删除前台登录页面中产生验证码的那些代码。修改前注意备份。
你的版本是多少,解答如下:
方法一:(http://houdunwangcom/lessonhtml)
php 54没有session_register方法,所以需要在include/userloginclassphp中加入以下代码
functionsession_register(){
$args= func_get_args();
foreach($argsas$key){
$_SESSION[$key]=$GLOBALS[$key];
}
}
方法二:
由于php 54没有session_register方法。
找开include/userloginclassphp文件,查找以下内容:
@session_register($this->keepUserIDTag);
$_SESSION[$this->keepUserIDTag] = $this->userID;
@session_register($this->keepUserTypeTag);
$_SESSION[$this->keepUserTypeTag] = $this->userType;
@session_register($this->keepUserChannelTag);
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
@session_register($this->keepUserNameTag);
$_SESSION[$this->keepUserNameTag] = $this->userName;
@session_register($this->keepUserPurviewTag);
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
@session_register($this->keepAdminStyleTag);
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
PutCookie(‘DedeUserID’, $this->userID, 3600 24, ‘/’);
PutCookie(‘DedeLoginTime’, time(), 3600 24, ‘/’);
替换成
global $admincachefile,$adminstyle;
if(empty($adminstyle)) $adminstyle = ‘dedecms’;
//@session_register($this->keepUserIDTag);
$_SESSION[$this->keepUserIDTag] = $this->keepUserIDTag;
$_SESSION[$this->keepUserIDTag] = $this->userID;
//@session_register($this->keepUserTypeTag);
$_SESSION[$this->keepUserTypeTag] = $this->keepUserTypeTag;
$_SESSION[$this->keepUserTypeTag] = $this->userType;
// @session_register($this->keepUserChannelTag);
$_SESSION[$this->keepUserChannelTag] = $this->keepUserChannelTag;
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
//@session_register($this->keepUserNameTag);
$_SESSION[$this->keepUserNameTag] = $this->keepUserNameTag;
$_SESSION[$this->keepUserNameTag] = $this->userName;
//@session_register($this->keepUserPurviewTag);
$_SESSION[$this->keepUserPurviewTag] = $this->keepUserPurviewTag;
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
// @session_register($this->keepAdminStyleTag);
$_SESSION[$this->keepAdminStyleTag] = $this->keepAdminStyleTag;
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
PutCookie(‘DedeUserID’, $this->userID, 3600 24, ‘/’);
PutCookie(‘DedeLoginTime’, time(), 3600 24, ‘/’);
方法三:
文件夹权限问题
验证码无法显示和自动登出的原因是因为date文件夹和date下面的sessions文件夹的写入权限没有!
Sessions是记录(传送)登入信息的文件夹, 它无法生成文件, 自然就无法登陆而跳转回来。
解决办法如下:
修改date和date下面的sessions文件夹的权限,(可以尝试在FLASHFXP上修改,但可能会造成失败)
所以建议直接在主机的控制面板里面修改date和sessions的权限为777(writen)
方法四:
重新安装dedecms然后用数据库备份还原数据库
方法五(本人所用):
phpini配置文件中
sessionbug_compat_42 = 1
sessionbug_compat_warn = 1
这是php430以后才有的安全设置。出于安全的考虑php不建议你打开register_globals开关但若关闭了register_globals(默认)时,session变量将不被自动转换成全局变量此时传统的session变量注册方式session_register就失去意义了(session_register是把一个全局变量注册成session变量),因为访问session变量需要使用$_SESSION数组。因此只需直接操作$_SESSION数组就可以了,而无须再用session_register注册了。以免产生混乱开关sessionbug_compat_42 和 sessionbug_compat_warn 就是为了检查此类情况而设置的
更多问题到问题求助专区(http://bbshoudunwangcom/)
0条评论