$membermodel = new membermodel($mtype);
$modid=$membermodel->modid;
$modid = empty($modid)? 0 : intval(preg_replace("/[^\d]/",'', $modid));
$modelform = $dsql->getOne("select * from dede_member_model where id='$modid' ");
if(!is_array($modelform))
{
showmsg('模型表单不存在', '-1');
exit();
}else{
$dsql->ExecuteNoneQuery("INSERT INTO `{$membermodel->table}` (`mid`) VALUES ('{$mid}');");
}
//----------------------------------------------
//模拟登录
//---------------------------
$cfg_ml = new MemberLogin(7*3600);
$rs = $cfg_ml->CheckUser($userid, $userpwd);
//邮件验证
if($cfg_mb_spacesta==-10)
{
$userhash = md5($cfg_cookie_encode.'--'.$mid.'--'.$email);
$url = $cfg_basehost.(empty($cfg_cmspath) ? '/' : $cfg_cmspath)."/member/index_do.php?fmdo=checkMail&mid={$mid}&userhash={$userhash}&do=1";
$url = eregi_replace('http://', '', $url);
$url = 'http://'.eregi_replace('//', '/', $url);
$mailtitle = "{$cfg_webname}--会员邮件验证通知";
$mailbody = '';
$mailbody .= "尊敬的用户[{$uname}],您好:\r\n";
$mailbody .= "欢迎注册成为[{$cfg_webname}]的会员。\r\n";
$mailbody .= "要通过注册,还必须进行最后一步操作,请点击或复制下面链接到地址栏访问这地址:\r\n\r\n";
$mailbody .= "{$url}\r\n\r\n";
$mailbody .= "Power by http://www.dedecms.com 织梦内容管理系统!\r\n";
$headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail;
if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server))