<% '================================== ' 会员页面 ' 更新时间: 2006-1-9 '================================== Dim blog_Mem, Referer_Url If Request.QueryString("action") = "edit" Then If memName = Empty Then RedirectUrl("member.asp") Referer_Url = Cstr(Request.ServerVariables("HTTP_REFERER")) If len(Referer_Url) < 8 then Referer_Url= "http://" & Request.ServerVariables("HTTP_HOST") Session(CookieName & "_Member_Referer_Url") = Referer_Url %>

修改用户信息
<%Set blog_Mem = conn.Execute("select * from blog_Member where mem_Name='"&CheckStr(memName)&"'") If blog_Mem.EOF Or blog_Mem.bof Then %>
无法找到该用户信息!!
单击返回
<%else%> "/> <% End If blog_Mem.Close Set blog_Mem = Nothing %>
 昵 称:<%=blog_Mem("mem_Name")%>
 旧密码: * 输入您的旧密码.下面的密码输入框为空则不修改密码
 密 码: 密码必须是6到16个字符,建议使用英文和符号混合
密码强度:  
密码重复: 必须和上面的密码一样
 性 别:/> 保密 />男 />女
电子邮件:"/> />
个人主页:"/>
QQ号码:"/>


<% ElseIf Request.QueryString("action") = "view" Then %>

用户信息
<% If CheckStr(Request.QueryString("memName")) = Empty Then %>
非法操作!!无法完成您的请求!
单击返回
<% Else Set blog_Mem = conn.Execute("select * from blog_Member where mem_Name='"&CheckStr(Request.QueryString("memName"))&"'") If blog_Mem.EOF Or blog_Mem.bof Then %>
无法找到该用户信息!!
单击返回
<%else%> <% End If blog_Mem.Close Set blog_Mem = Nothing End If %>
 昵 称:<%=blog_Mem("mem_Name")%>
 性 别:<% Select Case Int(blog_Mem("mem_Sex")) Case 1 response.Write "我是GG" Case 2 response.Write "我是MM" Case Else response.Write "保密" End Select %>
电子邮件:<%if (blog_Mem("mem_HideEmail") and (not stat_Admin)) or len(blog_Mem("mem_Email"))<1 or isnull(blog_Mem("mem_Email")) then response.write "该用户没有或不公开电子邮件" else response.write blog_Mem("mem_Email") end if%>
个人主页:" target="_blank"><%=blog_Mem("mem_HomePage")%>
 QQ号码:<%=blog_Mem("mem_QQ")%>
统计:日志共 <%=blog_Mem("mem_PostLogs")%> 篇,评论共 <%=blog_Mem("mem_PostComms")%> 篇,留言共 <%=blog_Mem("mem_PostMessageNums")%> 个。


<% ElseIf Request.Form("action") = "save" Then Dim reg Referer_Url = Session(CookieName & "_Member_Referer_Url") If len(Referer_Url) < 8 then Referer_Url = Cstr(Request.ServerVariables("HTTP_REFERER")) If len(Referer_Url) < 8 then Referer_Url = "http://" & Request.ServerVariables("HTTP_HOST") reg = SaveMem %>

<%=reg(0)%>
<%=reg(1)%>


<% Else Dim searchType Dim PageCount, BM Set blog_Mem = Server.CreateObject("ADODB.RecordSet") SQL = "SELECT * FROM blog_Member order by mem_RegTime desc" blog_Mem.Open SQL, Conn, 1, 1 SQLQueryNums = SQLQueryNums + 1 blog_Mem.PageSize = 20 blog_Mem.AbsolutePage = CurPage %>

用户列表
<%If blog_Mem.EOF Or blog_Mem.bof Then response.Write "没找到任何注册用户!" Else %> <% Do Until blog_Mem.EOF Or PageCount = blog_Mem.PageSize If blog_Mem("mem_HideEmail") Or Len(blog_Mem("mem_Email"))<1 Or IsNull(blog_Mem("mem_Email")) Then BM = "" Else BM = "" End If If Len(blog_Mem("mem_HomePage"))<1 Or IsNull(blog_Mem("mem_HomePage")) Then BM = BM&"" Else BM = BM&"" End If If Len(blog_Mem("mem_QQ"))<1 Or IsNull(blog_Mem("mem_QQ")) Then BM = BM&"" Else BM = BM&"" End If response.Write ""&BM&"" PageCount = PageCount + 1 blog_Mem.movenext Loop response.Write "
用户名邮件主页QQ日志评论留言注册时间
"&blog_Mem("mem_Name")&""&blog_Mem("mem_PostLogs")&""&blog_Mem("mem_PostComms")&""&blog_Mem("mem_PostMessageNums")&""&DateToStr(blog_Mem("mem_RegTime"), "Y-m-d H:I A")&"
" response.Write "
"&MultiPage(blog_Mem.RecordCount, 20, CurPage, "?", "", "float:left","")&"
" End If blog_Mem.Close Set blog_Mem = Nothing %>


<%End if%>
<% Function SaveMem Dim ReInfo Dim UID, username, Oldpassword, password, Confirmpassword, Gender, email, homepage, QQ, HideEmail, checkUser UID = CLng(Trim(CheckStr(request.Form("UID")))) ReInfo = Array("错误信息", "", "MessageIcon") Oldpassword = Trim(CheckStr(request.Form("Oldpassword"))) password = Trim(CheckStr(request.Form("password"))) Confirmpassword = Trim(CheckStr(request.Form("Confirmpassword"))) Gender = CheckStr(request.Form("Gender")) email = Trim(CheckStr(request.Form("email"))) homepage = Trim(checkURL(CheckStr(request.Form("homepage")))) QQ = CheckStr(request.Form("QQ")) If request.Form("hiddenEmail") = 1 Then HideEmail = True Else HideEmail = False End If If IsInteger(Gender) = False Then ReInfo(0) = "错误信息" ReInfo(1) = "非法操作!
单击返回" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If Set checkUser = conn.Execute("select top 1 * from blog_Member where mem_id="&UID&" and mem_Name='"&CheckStr(memName)&"'") If checkUser.EOF Then ReInfo(0) = "错误信息" ReInfo(1) = "不存在此用户
操作失败!

单击返回" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If If Len(password)>0 Then If Len(password)<6 Or Len(password)>16 Then ReInfo(0) = "错误信息" ReInfo(1) = "请输入6到16位密码!
单击返回" ReInfo(2) = "WarningIcon" SaveMem = ReInfo Exit Function End If If password<>Confirmpassword Then ReInfo(0) = "错误信息" ReInfo(1) = "两次密码输入不一致!请重新输入。
单击返回" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If End If If Len(QQ)>0 And IsInteger(QQ) = False Then ReInfo(0) = "错误信息" ReInfo(1) = "非法QQ号
单击返回" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If If Len(email)>0 And IsValidEmail(email) = False Then ReInfo(0) = "错误信息" ReInfo(1) = "错误的电子邮件地址。
单击返回" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If Set checkUser = conn.Execute("select top 1 * from blog_Member where mem_id="&UID&" and mem_Name='"&CheckStr(memName)&"'") If checkUser("mem_Password")<>SHA1(Oldpassword&checkUser("mem_salt")) Then ReInfo(0) = "错误信息" ReInfo(1) = "用户名与密码错误
请返回重新输入" ReInfo(2) = "ErrorIcon" SaveMem = ReInfo Exit Function End If Conn.Execute("update blog_member set mem_Sex="&Gender&",mem_Email='"&email&"',mem_HideEmail="&HideEmail&",mem_HomePage='"&homepage&"',mem_QQ='"&QQ&"' where mem_id="&UID&" and mem_Name='"&CheckStr(memName)&"'") SQLQueryNums = SQLQueryNums + 1 If Len(password)>0 Then Dim strSalt strSalt = randomStr(6) password = SHA1(password&strSalt) Conn.Execute("update blog_member set mem_Password='"&password&"',mem_salt='"&strSalt&"' where mem_id="&UID&" and mem_Name='"&CheckStr(memName)&"'") SQLQueryNums = SQLQueryNums + 1 logout(True) ReInfo(0) = "用户修改成功" ReInfo(1) = "您的资料已经修改成功
由于您更改了密码所以必须 重新登录
三秒后自动返回登录页面" ReInfo(2) = "MessageIcon" SaveMem = ReInfo Session(CookieName&"_LastDo") = "EditUser" Exit Function End If getInfo(2) ReInfo(0) = "用户修改成功" ReInfo(1) = "您的资料已经修改成功
返回首页 | 单击返回修改前页面
三秒后自动返回修改前页面" ReInfo(2) = "MessageIcon" SaveMem = ReInfo Session(CookieName&"_LastDo") = "EditUser" End Function %>