<?php
require("../../class/connect.php");
if(!defined('InEmpireCMS'))
{
	exit();
}
eCheckCloseMods('member');//关闭模块
$myuserid=(int)getcvar('mluserid');
$r=array();
$mhavelogin=0;
if($myuserid)
{
	include("../../member/class/user.php");
	include("../../data/dbcache/MemberLevel.php");
	$link=db_connect();
	$empire=new mysqlquery();
	$mhavelogin=1;
	//数据
	$myusername=RepPostVar(getcvar('mlusername'));
	$myrnd=RepPostVar(getcvar('mlrnd'));
	$qcklgr=qCheckLoginAuthstr();
	if(!$qcklgr['islogin'])
	{
		EmptyEcmsCookie();
		$mhavelogin=0;
	}
	else
	{
		$r=$empire->fetch1("select ".eReturnSelectMemberF('userid,username,groupid,userfen,money,userdate,havemsg,checked,isot,phno,upic')." from ".eReturnMemberTable()." where ".egetmf('userid')."='$myuserid' and ".egetmf('username')."='$myusername' and ".egetmf('rnd')."='$myrnd'".do_dblimit_one());
		if(empty($r['userid'])||$r['checked']==0||!$r['isot'])
		{
			EmptyEcmsCookie();
			$mhavelogin=0;
		}
	}
	//会员等级
	if(empty($r['groupid']))
	{$groupid=eReturnMemberDefGroupid();}
	else
	{$groupid=$r['groupid'];}
	$groupname=$level_r[$groupid]['groupname'];
	//点数
	$userfen=$r['userfen'];
	//余额
	$money=$r['money'];
	//天数
	$userdate=0;
	if($r['userdate'])
	{
		$userdate=$r['userdate']-time();
		if($userdate<=0)
		{$userdate=0;}
		else
		{$userdate=round($userdate/(24*3600));}
	}
	//是否有短消息
	$havemsg="";
	if($r['havemsg'])
	{
		$havemsg="<a href='".$public_r['newsurl']."e/member/msg/' target=_blank><font color=red>您有新消息</font></a>";
	}
	//$myusername=$r['username'];
}
//引用文件
@include(ECMS_PATH.'c/ecachetemp/emtemp/esp_loginiframe.php');
if($mhavelogin==1)
{
	db_close();
	$empire=null;
}
?>