$row['url'] = !ereg('http:',$row['url']) ? $GLOBALS['cfg_basehost'].$row['url'] : $row['url'];
if(!empty($row['url']))
{
$archives_list[] = array('title' => $row['title'],'writer' => $row['writer'],'pubdate' => $row['pubdate'],'url' => $row['url']);
}
}
$return = array($name, $archives_list);
return $this->_serialize($return, 1);
}
function synlogin($get, $post)
{
$uid = $get['uid'];
$username = $get['username'];
if(!API_SYNLOGIN)
{
return API_RETURN_FORBIDDEN;
}
//note 同步登录 API 接口
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$result = $this->db->GetOne("SELECT mid,pwd FROM `dede_member` WHERE `userid` like '$username' AND matt<>10");
if(is_array($result))
{
include_once DEDEINC.'/memberlogin.class.php';
$cfg_ml = new MemberLogin(86400);
$cfg_ml->PutLoginInfo($result['mid']);
}
else
{
//如果没有激活,则自动添加该用户到数据库,并设置已激活状态的cookie
//会员的默认金币
$dfscores = 0;
$dfmoney = 0;
$dfrank = $this->db->GetOne("Select money,scores From `dede_arcrank` where rank='10' ");
if(is_array($dfrank))
{
$dfmoney = $dfrank['money'];
$dfscores = $dfrank['scores'];
}
$jointime = time();
$logintime = time();
$joinip = $get['regip'];
$loginip = $get['regip'];
$pwd = $get['password'];
$spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
$mtype='个人';
$email=$get['email'];
$inQuery = "INSERT INTO `dede_member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
`matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
VALUES ('$mtype','$username','$pwd','$username','保密','10','$dfmoney','$email','$dfscores',
'0','$spaceSta','','','','$jointime','$joinip','$logintime','$loginip'); ";
if($this->db->ExecuteNoneQuery($inQuery))
{
$mid = $this->db->GetLastID();
//写入默认会员详细资料
$space='person';
//写入默认统计数据
$membertjquery = "INSERT INTO `dede_member_tj` (`mid`,`article`,`album`,`archives`,`homecount`,`pagecount`,`feedback`,`friend`,`stow`)
VALUES ('$mid','0','0','0','0','0','0','0','0'); ";
$this->db->ExecuteNoneQuery($membertjquery);
//写入默认空间配置数据
$spacequery = "Insert Into `dede_member_space`(`mid` ,`pagesize` ,`matt` ,`spacename` ,`spacelogo` ,`spacestyle`, `sign` ,`spacenews`)
Values('$mid','10','0','$username的空间','','$space','',''); ";
$this->db->ExecuteNoneQuery($spacequery);
//写入其它默认数据
$this->db->ExecuteNoneQuery("INSERT INTO `dede_member_flink`(mid,title,url) VALUES('$mid','织梦内容管理系统',''); ");
include_once DEDEINC.'/membermodel.cls.php';
$membermodel = new membermodel($mtype);
$modid=$membermodel->modid;
$modelform = $this->db->getOne("select * from dede_member_model where id='$modid' ");
$this->db->ExecuteNoneQuery("INSERT INTO `{$membermodel->table}` (`mid`) VALUES ('$mid');");
//----------------------------------------------
//模拟登录
//---------------------------
include_once DEDEINC.'/memberlogin.class.php';
$cfg_ml = new MemberLogin(7*3600);
$cfg_ml->PutLoginInfo($mid);
}
}
}
function synlogout($get, $post)
{
if(!API_SYNLOGOUT)
{
return API_RETURN_FORBIDDEN;
}