<!--#include file="conn.asp"-->
<!-- #include file="inc/htmlencode2.asp"-->
<!-- #include file="inc/ubbcode.asp"-->
<!--#include file="inc/md5.asp" -->
<!--#include file="bbsuser.asp"-->
<%
password=trim(request.form("password"))
oldpwd=trim(request.form("oldpwd"))
clubuser_marriage=request.form("clubuser_marriage")
question=Checkstr(trim(request.form("question")))
answer=trim(request.form("answer"))
signname=Checkstr(request.form("signname"))
email=Checkstr(trim(request.form("email")))
clubuser_address=Checkstr(trim(request.form("clubuser_address")))
url=request("url")

call FTBBS_HTML_MB(ft)
pswlng=Application("FTBBSMB")(23,0)
pswlng1=int(split(pswlng,"-")(0))
pswlng2=int(split(pswlng,"-")(1))

call CheckCharStr(password,1)
call CheckCharStr(oldpwd,1)
if (len(password)>pswlng2 or len(password)<pswlng1) and password<>"" then
   call ftbbs_msg("密码长度为:"&pswlng&"个字符","moduserinfo.asp")
end if
if len(request.form("signname"))>150 then
   call ftbbs_msg("签名档不能超过150字！","moduserinfo.asp")
end if
set rs_arrest=server.createobject("adodb.recordset")
Sql_arrest="select * from "&ft&"BBS_arrest where kind='Keyword' order by id asc"
rs_arrest.open sql_arrest,conn,1,1
do while not rs_arrest.eof
	if (instr(request.form("signname"),rs_arrest("content"))<>0 or instr(request.form("name"),rs_arrest("content"))<>0) then
		call ftbbs_msg("对不起，所填内容中不能含有["&rs_arrest("content")&"]关键字！","moduserinfo.asp")		
	end if
rs_arrest.movenext
loop
rs_arrest.close
set rs_arrest=nothing

sql="select * from "&ft&"clubuser where clubuser_name='"&request.cookies("name")&"'"
set rsr=server.createobject("adodb.recordset")
rsr.open sql,conn,1,3
clubuser_password=md5(password)
clubuser_answer=rsr("clubuser_answer")
if clubuser_answer<>answer then
answer=md5(answer)
end if
if password<>"" then
   if rsr("clubuser_password")=md5(oldpwd) then
    rsr("clubuser_password")=clubuser_password
	rsr("clubuser_answer")=answer
	clubuser_password=CodeCookie(clubuser_password)
	call setcookie(1,ckiesdomain,"clubuser_password",clubuser_password)
   else
	call ftbbs_msg("密码修改要验证原始密码，你输入的原始密码不正确,修改失败！","moduserinfo.asp")
   end if
elseif password="" and clubuser_answer<>answer then
   if rsr("clubuser_password")=md5(oldpwd) then
   rsr("clubuser_answer")=answer
   else
   call ftbbs_msg("问题答案修改要验证原始密码，你输入的原始密码不正确,修改失败！","moduserinfo.asp")
   end if
end if
rsr("clubuser_question")=question
rsr("clubuser_sex")=request.form("sex")
rsr("clubuser_email")=email
rsr("signname")=signname
rsr("clubuser_marriage")=clubuser_marriage
rsr("clubuser_address")=clubuser_address
if request("img")<>"" then
 rsr("userimg")=request("img")
end if
rsr.update
rsr.close
conn.close

msg="恭喜你，修改个人信息成功！"
sign=1
call ftbbs_msg("恭喜你，修改个人信息成功！",url)
%>