直接用下面的代码,覆盖dede中的login.php即可
复制代码 代码如下:
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_userlogin.php");
if(empty($dopost)) $dopost="";
//--------------------------------
//登录检测
//--------------------------------
if($dopost=="login")
{
if(empty($validate)) $validate=="";
else $validate = strtolower($validate);
if( empty($_SESSION["s_validate"]) ) $svali = "";
else $svali = $_SESSION["s_validate"];
$cuserLogin = new userLogin();
if(!empty($userid)&&!empty($pwd))
{
$res = $cuserLogin->checkUser($userid,$pwd);
//成功登录
if($res==1){
$cuserLogin->keepUser();
if(!empty($gotopage)){
//header("location:$gotopage");
ShowMsg("成功登录,正在转向管理管理主页!",$gotopage);
exit();
}
else{
ShowMsg("成功登录,正在转向管理管理主页!","index.php");
//header("location:index.php");
exit();
}
}
else if($res==-1){
ShowMsg("你的用户名不存在!","");
}
else{
ShowMsg("你的密码错误!","");
}
}// else{
ShowMsg("用户和密码没填写完整!","");
}
//}
?>
| ||
| ||
| ||