Exemple #1
0
function loginout($userid,$username,$rnd){
	global $empire,$dbtbpre,$ecms_config;
	$userid=(int)$userid;
	if(!$userid||!$username)
	{
		printerror("NotLogin","history.go(-1)");
	}
	$set1=esetcookie("loginuserid","",0,1);
	$set2=esetcookie("loginusername","",0,1);
	$set3=esetcookie("loginrnd","",0,1);
	$set4=esetcookie("loginlevel","",0,1);
	//COOKIERND
	DelECookieRnd();
	DelESessionRnd();
	DelECookieAdminLoginFileInfo();
	//FireWall
	FWEmptyPassword();
	//取得随机密码
	$rnd=make_password(20);
	$sql=$empire->query("update {$dbtbpre}enewsuser set rnd='$rnd' where userid='$userid'");
	DoEDelFileRnd($userid);
	DoEDelAndAuthRnd($userid);
	//操作日志
	insert_dolog("");
	printerror("ExitSuccess","index.php");
}
Exemple #2
0
function DoECreatAndAuthRnd($userid, $username, $rnd, $userkey, $dbdata, $groupid, $adminstyle, $truelogintime, $ip, $sessval)
{
    global $empire, $dbtbpre, $ecms_config;
    $andauth = md5(md5($rnd . '-' . $username . '-empirecms!check.andauth' . $truelogintime . '-' . $ecms_config['esafe']['ecookiernd'] . $userkey) . $sessval . '-' . $ip . '-' . $userid . $rnd . '-' . $adminstyle . '-' . $groupid . $username . '-' . $dbdata);
    DoEDelAndAuthRnd($userid);
    $empire->query("replace into {$dbtbpre}enewsuserloginck(userid,andauth) values('{$userid}','{$andauth}');");
}