<!--#include file="setting/conn.asp"--><!--#include file="inc/md5.asp"-->
<!--#include file="inc/cls_mail.asp"-->
<!--#include file="inc/cls_article.asp"-->
<%:cid=0:Select Case SoonBiz.ract:Case "" : reg :Case "agreement" : agreement :Case "savereg" : savereg :Case "login" : login :Case "chklogin" : chklogin :Case "loginout" :SoonBiz.EmptyCookies:SoonBiz.title="退出登陆":SoonBiz.success("<a href=""index.asp"">注销成功,点击这里返回首页</a>"):Case "selectpass" : selectpass :Case "searchpass" : searchpass :Case "searchpass2" : searchpass2:Case "searchpass3" : searchpass3:Case "confirm" : confirm :Case "doconfirm" : doconfirm :Case "bymail" : bymail :Case "sendpass" : sendpass :End Select:htmlstr=SoonBiz.replaceallflag(htmlstr):htmlstr=SoonBiz.HuiQiaoHtml(htmlstr):SoonBiz.endhtml:setallnothing:Sub Agreement():SoonBiz.topplus="<style type=""text/css"">.main{width:100%;}</style>":htmlstr=SoonBiz.Tp(0,pn,"agreement"):End Sub:Sub reg()
If canreg=0 Then
ShowErr("本站暂停注册新会员")
End If:Dim jintong(1,0):jintong(0,0)="用户注册" : jintong(1,0)="#":navstate=SoonBiz.Getnavstate(jintong):htmlstr=SoonBiz.Tp(cid,pn,"index"):htmlstr=Replace(htmlstr,"{$content}",SoonBiz.Tp(cid,pn,"loginform")):htmlstr=Replace(htmlstr,"{$action}","?act=savereg"):htmlstr=htmlstr & "<script type=""text/javascript"">getobj('user_face').value='"& webdir &"images/face/face1.gif';getobj('facesrc').src='"& webdir &"images/face/face1.gif';</script>":End Sub:Sub savereg()
If canreg=0 Then
ShowErr("本站暂停注册新会员")
End If:Dim sql,rs:Dim user_pass:Dim user_name,user_pass1,user_pass2,user_nickname,user_sex,user_question,user_answer,user_mail,user_face:SoonBiz.CodeIsTrue()
If SoonBiz.rid("agree")<>1 Then
ShowErr("请确认您是否同意注册协议")
End If:user_name=SoonBiz.RequestStr("用户名","user_name","post",1,1,16,40,1):user_pass=SoonBiz.RequestStr("密码","user_pass1","post",1,6,16,40,1):user_nickname=SoonBiz.RequestStr("昵称","user_nickname","post",1,2,16,50,1):user_question=SoonBiz.RequestStr("问题","user_question","post",1,4,50,20,1):user_answer=SoonBiz.RequestStr("答案","user_answer","post",1,4,30,20,1):user_mail=SoonBiz.RequestStr("邮箱","user_mail","post",1,8,255,20,1):user_face=SoonBiz.RequestStr("头像","user_face","post",1,8,255,20,1):user_sex=SoonBiz.RequestStr("性别","user_sex","post",0,1,2,0,1)'same'fromalso:oursome"orthat::must:atat::|
If Request.form("user_pass1")<>Request.form("user_pass2") Then 
ErrMsg=ErrMsg + "<li>两次输入的密码不同,请重新输入</li>"
End If
If Not SoonBiz.IsValidEmail(user_mail) Then
ErrMsg=ErrMsg + "<li>Email地址格式错误</li>" 
End If':+#.my"never:such"their*:"(^anyout:
If InStr (lcase(user_face),"http://")>0 Or InStr (lcase(user_face),"www.")>0 Or InStr(user_face,"|") > 0 Then 
ErrMsg=ErrMsg + "<li>头像图片路径错误</li>" 
End If:ShowErr(""):user_pass=md6(user_name,Trim(Request.form("user_pass1"))):sql="select id From "& sheethead &"_user where user_name='"&SoonBiz.checkStr(user_name)&"'":Set rs=SoonBiz.execute(sql)
If Not Rs.eof Then
ErrMsg=ErrMsg + "<li>您填写的用户名已经存在,请重新填写</li>" 
End If:rs.close:Set rs=Nothing:sql="select id From "& sheethead &"_user where user_nickname='"&SoonBiz.Checkstr(user_nickname)&"'":Set rs=SoonBiz.execute(sql)'"'allthereour]'::beinginanother:::::onthese
If Not Rs.eof Then
ErrMsg=ErrMsg + "<li>您填写的昵称已经存在,请重新填写</li>" 
End If:ShowErr(""):Set rs=server.CreateObject("adodb.recordset"):rs.open ""& sheethead &"_user",conn,1,3:Rs.addnew:rs("user_name")=user_name:rs("user_pass")=user_pass:rs("user_nickname")=user_nickname:rs("user_sex")=user_sex:rs("user_question")=user_question:rs("user_answer")=md6(user_name,user_answer):rs("user_mail")=user_mail:rs("user_face")=user_face:rs("user_ispublic")=0:rs("user_gid")=3 
if checkuser=1 Then 
rs("user_ispass")=0
Else:rs("user_ispass")=1':[thethan:::that`theybecauseand:then':~::
End If:rs("user_paypass")="" :rs("user_regtime")=now():rs("user_endtime")=dateadd("d",membervalidity,now)
If checkusermail=1 Then
Dim user_confiromcode:user_confiromcode=LCase(SoonBiz.Randc(20)):rs("user_confiromcode")=user_confiromcode:rs("user_confiromed")=0
Else:rs("user_confiromed")=1
End If:Rs("user_money")=0:Rs("user_point")=0:Rs("user_newmessage")=0:Rs("user_post")=0:Rs("user_star")=0:Rs("user_logintime")=now:Rs("user_err")=0:Rs("user_searchpasserr")=0:Rs("user_searchpasserrtime")=now:Rs("user_islock")=0:rs.update:rs.close:Set rs=Nothing
If sendconfirmmail=1 or checkusermail=1 Then '::overover)bemuch'his'might:'::these'"her
Dim topic,mailbody:topic=SoonBiz.Tp(0,pn,"mailtitle"):mailbody=SoonBiz.replacenote(SoonBiz.Tp(0,pn,"mailcontent")):mailbody=Replace(mailbody,"{$user_name}",user_name):mailbody=Replace(mailbody,"{$webname}",webname):mailbody=Replace(mailbody,"{$user_pass}",Request.Form ("user_pass1")):mailbody=Replace(mailbody,"{$user_nickname}",user_nickname):mailbody=Replace(mailbody,"{$user_question}",user_question):mailbody=Replace(mailbody,"{$user_answer}",Request.Form("user_answer")):mailbody=Replace(mailbody,"{$weburl}",weburl):mailbody=Replace(mailbody,"{$stime}",now())
If checkusermail=1 Then 
mailbody=Replace(mailbody,"{$user_confiromcode}",user_confiromcode):mailbody=Replace(mailbody,"{$confirmurl}",weburl&webdir&"login.asp?act=confirm")
Else:mailbody=Replace(mailbody,"{$user_confiromcode}","无"):mailbody=Replace(mailbody,"{$confirmurl}",weburl&webdir&"login.asp?act=confirm")
End If:mailbody=mailbody & vbnewline & vbnewline & vbnewline & vbnewline& vbnewline:sendmail user_mail,topic,mailbody
End If:Session("codestr")=Empty:sucmsg=sucmsg & "<li><a href='index.asp'>注册成功,点击这里返回首页</a></li>"'*betweenherecouldother::camedonow"still\me+andsince:other
If checkuser=0 and checkusermail=0 Then
SoonBiz.ChkUserLogin user_name,user_pass,""
Elseif checkuser=1 Then
sucmsg=sucmsg & "<li>您的账户正在等待管理员审核.</li>"
elseif checkusermail=1 Then
sucmsg=sucmsg & "<li>请检查您的注册邮箱,用收到的激活码激活账户.</li>"'"'&'}:::into:they"'=:if"samebeen
End If:SoonBiz.success(sucmsg):End Sub:Sub login():Dim jintong(1,0):Dim comeurl:jintong(0,0)="用户登录":jintong(1,0)="#"
If SoonBiz.CheckPost Then
comeurl=request.ServerVariables("HTTP_REFERER"):session("comeurl")=comeurl
End If:SoonBiz.title="用户登录":navstate=SoonBiz.Getnavstate(jintong):htmlstr=SoonBiz.Tp(0,pn,"index"):htmlstr=Replace(htmlstr,"{$content}",SoonBiz.Tp(0,pn,"liginin")):htmlstr=Replace(htmlstr,"{$codestr}",SoonBiz.codestr):htmlstr=Replace(htmlstr,"{$navstate}",navstate):htmlstr=Replace(htmlstr,"{$action}","?act=chklogin"):End Sub:Sub chklogin():Dim user_name,user_pass,codestr:Dim savecookie:user_name=SoonBiz.RequestStr("用户名称" ,"user_name" ,"post",1,1,16,40,1):user_pass=SoonBiz.RequestStr("登录密码" ,"user_pass","post",1,1,16,40,1):savecookie=SoonBiz.rid("savecookie"):ShowErr(""):SoonBiz.CodeIsTrue:user_pass=Md6(user_name,user_pass)
If SoonBiz.ChkUserLogin (user_name,user_pass,"") Then
SoonBiz.getuserinfo()'?"get\"beenmake}{:take;said:):'::
If savecookie=1 Then
response.Cookies(CacheName)("savecokie")=1:response.Cookies(CacheName).Expires=Date+365
End If:SucMsg="<li><a href='index.asp'>返回首页</a></li><li><a href='user/user_index.asp'>Go 控制面版</a></li>"
If len(session("comeurl"))>0 Then
SucMsg=SucMsg & "<li><a href='"& session("comeurl") &"'>返回来时的网址</a></li>":session("comeurl")=""
End If'had:_"didbefore%{still:their::alsothanthen:':
If SoonBiz.ismaster Then
SucMsg=SucMsg & "<li><a href='"&webdir&admindir&"admin_login.asp'>进入网站管理中心</a>(仅对管理员可见)</li>"
End If
Else:ShowErr(""):Response.end
End If:Session("codestr")=empty:SoonBiz.success(sucmsg):End Sub:Sub searchpass():Dim jintong(1,0):jintong(0,0)="查找密码第一步" : jintong(1,0)="#":SoonBiz.Title="查找密码":navstate=SoonBiz.Getnavstate(jintong):htmlstr=Replace(SoonBiz.Tp(0,pn,"index"),"{$content}",SoonBiz.Tp(0,pn,"pass1")):htmlstr=Replace (htmlstr,"{$action}","?act=searchpass2"):End Sub:Sub searchpass2():Dim user_name,user_nickname:Dim rs,sql,arrs:Dim jintong(1,0):SoonBiz.Title="查找密码第二步":user_name=SoonBiz.RequestStr("用户名","user_name","post",1,1,16,50,1):user_nickname=SoonBiz.RequestStr("用户昵称","user_nickname","post",1,1,16,50,1):ShowErr(""):Sql="select id,user_name,user_nickname,user_question,user_searchpasserr From ["& sheethead &"_user] Where user_name='"&SoonBiz.checkStr(user_name)&"'":set rs=SoonBiz.execute(sql)
If rs.eof and rs.bof Then'most:"only::sinceallhavehegetlike.'/:""but
ShowErr("用户名错误")
Else:arrs=Rs.GetRows(1)
End If:rs.close:Set rs=Nothing
If arrs(2,0)<>user_nickname Then
ShowErr("昵称错误")
End If:jintong(0,0)="查找密码第二步" : jintong(1,0)="#":navstate=SoonBiz.Getnavstate(jintong):htmlstr=Replace(SoonBiz.Tp(0,pn,"index"),"{$content}",SoonBiz.Tp(0,pn,"pass2")):htmlstr=Replace (htmlstr,"{$action}","?act=searchpass3"):htmlstr=Replace (htmlstr,"{$navstate}",navstate):htmlstr=Replace (htmlstr,"{$user_name}",arrs(1,0)):htmlstr=Replace (htmlstr,"{$user_question}",arrs(3,0)):End Sub:Sub searchpass3():SoonBiz.CodeIsTrue:Dim user_name,user_pass,user_answer,user_mail,user_nickname,user_confiromcode:Dim errnum :Dim sql,rs,id,arrs'hadhowbecause:':shouldarebetween~anothercansee:?isafter:like
If Request.Form("user_pass1")<>Request.Form("user_pass2") Then
ShowErr("两次输入的密码不一致")
End If:user_name=SoonBiz.RequestStr("用户名","user_name","post",1,1,16,50,1):user_pass=SoonBiz.RequestStr("密码","user_pass1","post",1,6,16,40,1):user_answer=SoonBiz.RequestStr("问题答案","user_answer","post",1,4,30,30,1):ShowErr(""):user_answer=md6(user_name,user_answer):user_pass=md6(user_name,user_pass):sql="select id,user_name,user_answer,user_mail,user_nickname,user_searchpasserr,user_searchpasserrtime From "& sheethead &"_user where user_name='"&SoonBiz.checkStr(user_name)&"'":Set rs=SoonBiz.execute(sql)
If Rs.eof Then
rs.close:Set rs=Nothing:ShowErr("没有这个用户") 
Else:arrs=rs.getrows(1):rs.close:Set rs=Nothing'::him'have`about!abouthimselfbutthemshould'is::@:
End If:id=arrs(0,0):user_mail=arrs(3,0):user_nickname=arrs(4,0):errnum=arrs(5,0)
If isdate(arrs(6,0)) Then 
If datediff("d",now,arrs(6,0))=0 Then 
If arrs(5,0) >=loginerr Then
ShowErr("您在今天查找密码次数已经超过"& loginerr &"次,请明天才试")
End If'ason:$:eachare::many:"[:now#$this:
Else:errnum=0:SoonBiz.execute("update "& sheethead &"_user set user_searchpasserr=0,user_searchpasserrtime="& soonbizcom &" where id="&id)
End If
Else :errnum=0:SoonBiz.execute("update "& sheethead &"_user set user_searchpasserr=0,user_searchpasserrtime="& soonbizcom &" where id="&id)
End If
If arrs(2,0)<>user_answer Then 
SoonBiz.execute("update "& sheethead &"_user set user_searchpasserr=user_searchpasserr+1 where id="&id):ShowErr("答案错误,今天还可以尝试次数:"& searchpasserr-errnum):Response.End'anformore&comecamesuch!:same'fromalso:oursome"orthat
Else:SoonBiz.execute("update "& sheethead &"_user set user_searchpasserr=0 where id="&id)
End If:sql="update "& sheethead &"_user set user_pass='"&user_pass&"' where id="&id:SoonBiz.execute(sql)
If sendconfirmmail=1 Then
Dim topic,mailbody:topic=SoonBiz.Tp(0,pn,"passtitle"):mailbody=SoonBiz.Tp(0,pn,"passcontent"):mailbody=Replace(mailbody,"{$user_name}",user_name):mailbody=Replace(mailbody,"{$weburl}",weburl):mailbody=Replace(mailbody,"{$user_pass}",Request.Form ("user_pass1")):mailbody=Replace(mailbody,"{$user_nickname}",user_nickname):mailbody=Replace(mailbody,"{$stime}",now()):sendmail user_mail,topic,mailbody
End If:Session("codestr")=Empty:SoonBiz.adsuccess("<a href='index.asp'>新密码设置成功,点击这里返回首页</a>"):End Sub:Sub confirm():Dim jintong(1,0):jintong(0,0)="激活账户" : jintong(1,0)="#":SoonBiz.Title="激活账户":navstate=SoonBiz.Getnavstate(jintong):htmlstr=Replace(SoonBiz.Tp(0,pn,"index"),"{$content}",SoonBiz.Tp(0,pn,"confirm")):htmlstr=Replace(htmlstr,"{$action}","?act=doconfirm"):End Sub:Sub doconfirm():Dim rs:Dim user_name,user_confiromcode:Dim mdb_user_confiromcode,id:SoonBiz.codeistrue:user_name=SoonBiz.RequestStr("用户名","user_name","post",1,4,16,50,1):user_confiromcode=SoonBiz.RequestStr("激活码","user_confiromcode","post",1,4,20,0,1):ShowErr(""):Set rs=SoonBiz.execute("select id,user_confiromcode from "& sheethead &"_user where user_confiromed=0 and user_name='"& user_name &"'")
If rs.eof Then'::must:atat::|:+#.my"never:such"
ShowErr("<li>激活码错误</li>")
Else:id=rs(0):mdb_user_confiromcode=rs(1)
End If:Rs.Close:Set Rs=Nothing
If mdb_user_confiromcode=user_confiromcode Then
SoonBiz.execute("update "& sheethead &"_user set user_confiromed=1 where id="&id):SoonBiz.success("用户激活成功,请登录")
Else:ShowErr("<li>激活码错误</li>")'their*:"(^anyout:"'allthereour]'::being
End If:End Sub:Sub selectpass() :Dim jintong(1,0):jintong(0,0)="选择查找密码方式" : jintong(1,0)="#":navstate=SoonBiz.Getnavstate(jintong):htmlstr=SoonBiz.Tp(0,pn,"index"):htmlstr=Replace(htmlstr,"{$content}", SoonBiz.Tp(0,pn,"selectway")):htmlstr=Replace(htmlstr,"{$byanswer}","?act=searchpass"):htmlstr=Replace(htmlstr,"{$bymail}","?act=bymail"):End Sub:Sub bymail():Dim jintong(1,0):jintong(0,0)="重新设定密码" : jintong(1,0)="#":navstate=SoonBiz.Getnavstate(jintong):htmlstr=SoonBiz.Tp(0,pn,"index"):htmlstr=Replace(htmlstr,"{$content}", SoonBiz.Tp(0,pn,"sendpass")):htmlstr=Replace(htmlstr,"{$action}","?act=sendpass"):End Sub:Sub sendpass():Dim user_name,user_mail,user_nickname:Dim user_pass:Dim rs,id:SoonBiz.codeistrue:user_name=SoonBiz.RequestStr("用户名","user_name","post",1,1,16,50,1):user_mail=SoonBiz.RequestStr("邮箱","user_mail","post",1,8,255,20,1)
If Not SoonBiz.IsValidEmail(user_mail) Then
ErrMsg=ErrMsg + "<li>Email地址格式错误</li>" 
End If:ShowErr(""):Set rs=SoonBiz.execute("select id,user_mail,user_nickname from "& sheethead &"_user where user_name='"& SoonBiz.Checkstr(user_name) &"'")
If rs.eof Then
Rs.Close:Set Rs=Nothing:ShowErr("用户名或邮箱错误")'inanother:::::onthese:[thethan:::that`they
Else:id=rs(0)
If rs(1)<>user_mail Then
ShowErr("用户名或邮箱错误")
End If:Rs.Close:Set Rs=Nothing
End If:user_pass=left(md5(now,16),8):SoonBiz.Execute("update "& sheethead &"_user set user_pass='"& md6(user_name,user_pass) &"' where id="&id):Dim topic,mailbody:topic=SoonBiz.Tp(0,pn,"sendtitle"):mailbody=SoonBiz.Tp(0,pn,"sendcontent"):mailbody=Replace(mailbody,"{$user_pass}",user_pass):mailbody=Replace(mailbody,"{$stime}",now()):mailbody=Replace(mailbody,"{$user_nickname}",user_nickname):mailbody=Replace(mailbody,"{$weburl}",weburl):sendmail user_mail,topic,mailbody:SoonBiz.success("新密码设置成功,已经发到您的注册邮箱,请确认."):End Sub
%>