<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->


<% call head()

Call saycarda("设置"&getcent&"密码")



dim action
action=request("action")
if action<>"" then
dim newpass,relpass
newpass = trim(Request.Form("newpass"))
relpass = trim(Request.Form("relpass"))

if newpass = "" then
  conn.close
  set conn=Nothing
  response.write "请输入"&getcent&"密码！"
  response.write "<br/><anchor><prev/>返回</anchor>"&chr(13)
  Call head1()
  response.end
end if

if relpass = "" then
  conn.close
  set conn=Nothing
  response.write "请输入重复"&getcent&"密码，必须与"&getcent&"密码相同！"
  response.write "<br/><anchor><prev/>返回</anchor>"&chr(13)
 Call headsay()
  response.end
end if

'-------

if ifbadchr("abcdefghijklmnopqrstuvwxyz0123456789",newpass) > 0 or len(newpass) < 6 or len(newpass) > 15 then
  conn.close
  set conn=Nothing
  response.write "新的密码必须是6至15位的英文小写字母或数字的组合！"&chr(13)
  response.write "<br/><anchor><prev/>重新输入</anchor>"&chr(13)
 Call headsay()
  response.end
end if

if relpass <> newpass then
  conn.close
  set conn=Nothing
  response.write "重复新密码必须与新密码相同！"&chr(13)
  response.write "<br/><anchor><prev/>重新输入</anchor>"&chr(13)
   Call headsay()
  response.end
end if

newpass = cstr(newpass)

set rs=server.createobject("adodb.recordset")
rs.open "select centmm from Users where ID = " & myid,conn,1,2

IF rs("centmm") <> "" THEN
    rs.close
    set rs=Nothing
    conn.close
    set conn=Nothing
    response.write ""&getcent&"密码已设置,不能更改！"&chr(13)
  response.write "<br/><anchor><prev/>返回</anchor>"&chr(13)
    Call headsay()
    response.end
END IF

rs("centmm") = newpass
rs.update
rs.close
set rs=nothing
conn.close
set conn=Nothing
response.write ""&getcent&"密码已经设置为"&relpass
response.write "<br/>请妥善保管此密码"
Response.write "<br/>注意：如忘记易币密码请联系客服或者论坛管理员。"
else%>
<%=getcent%>密码一旦设置不能修改,请慎重<br/>
<%=getcent%>密码(6-15位字母或数字)

<% If saytk>1 then%>
<form name="form" method="post" action="centsedit.asp?Action=save&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>">
<%End if%>
<br/><input type="password"  emptyok="false" name="newpass"/>
<br/>重复<%=getcent%>密码
<br/><input type="password"  emptyok="false" name="relpass"/>
<br/>

<% If saytk<>1 Then

response.write "<br/><input type=""submit"" name=""Submit"" value=""下一步""></form>"
else%>

<anchor>设置
<go href="centsedit.asp?action=save&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>" method="post">
<postfield name="newpass" value="$(newpass)"/>
<postfield name="relpass" value="$(relpass)"/>
</go></anchor>
<%end if%>
<%end if%>
<br/><a href="bankcl.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">返回社区银行</a>
<!--#include file="fanhui.asp"-->
<% Call headsay()%>