user_setting.asp
来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 905 行 · 第 1/3 页
ASP
905 行
Set rs = oblog.execute("select question from oblog_user where userid=" & oblog.l_uid)
%>
<div id="dTab12" class="Box">
<form name="oblogform" action="user_setting.asp" method="post">
<table class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td colspan="2" class="dTab12_body_top">修改密码</td>
</tr>
<tr>
<td class="dTab12_body_td">原密码:</td>
<td><input name="oldpassword" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td class="dTab12_body_td">新密码:</td>
<td><input name="newpassword" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td class="dTab12_body_td">重复密码:</td>
<td><input name="newpassword1" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td colspan="2" class="dTab12_body_end"><input name="action" type="hidden" value="saveuserpassword" /> <input type=submit value=" 修改密码 " /></td>
</tr>
</table>
</form>
<br />
<form name="oblogform" action="user_setting.asp" method="post">
<table class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td colspan="2" class="dTab12_body_top">更改找回密码设置</td>
</tr>
<tr>
<td class="dTab12_body_td">登录密码:</td>
<td><input name="password" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td class="dTab12_body_td">密码提示问题:</td>
<td><input name="question" type="text" size="30" maxlength="20" value="<%=oblog.filt_html(rs(0))%>"><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td class="dTab12_body_td">找回密码答案:</td>
<td><input name="answer" type="text" size="30" maxlength="20"><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td colspan="2" class="dTab12_body_end"><input name="action" type="hidden" value="saveuserlostpass"> <input type="submit" value=" 更新 "></td>
</tr>
</table>
</form>
</div>
<%
End Sub
Sub saveuserlostpass()
Dim password, question, answer, rs
password = Trim(request("password"))
question = Trim(request("question"))
answer = Trim(request("answer"))
If password = "" Then oblog.adderrstr ("错误:登录密码不能为空!")
If question = "" Then oblog.adderrstr ("错误:提示问题不能为空!")
If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
Set rs = server.CreateObject("adodb.recordset")
rs.open "select question,answer from oblog_user where userid="&oblog.l_uid&" and password='"&md5(password)&"'",conn,1,3
If rs.EOF Then
rs.Close
Set rs = Nothing
oblog.adderrstr ("错误:登录密码输入错误!")
oblog.showusererr
Exit Sub
Else
If API_Enable Then
Dim blogAPI
Set blogAPI = New DPO_API_OBLOG
blogAPI.LoadXmlFile True
blogAPI.UserName=oblog.l_uName
blogAPI.PassWord=password
blogAPI.Question=Question
blogAPI.Answer=Answer
Call blogAPI.ProcessMultiPing("update")
Set blogAPI=Nothing
End If
rs("question") = question
If answer <> "" Then rs("answer") = md5(answer)
rs.Update
rs.Close
Set rs = Nothing
oblog.showok "修改找回密码资料成功!", ""
End If
End Sub
Sub saveuserpassword()
Dim oldpassword, newpassword, rs
oldpassword = Trim(request("oldpassword"))
newpassword = Trim(request("newpassword"))
If oldpassword = "" Then oblog.adderrstr ("错误:原密码不能为空!")
If newpassword = "" Or oblog.strLength(newpassword) > 14 Or oblog.strLength(newpassword) < 4 Then oblog.adderrstr ("错误:新密码不能为空(不能大于14小于4)!")
If newpassword <> Trim(request("newpassword1")) Then oblog.adderrstr ("错误:重复密码输入错误!")
If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
Set rs = server.CreateObject("adodb.recordset")
rs.open "select password from oblog_user where userid="&oblog.l_uid&" and password='"&md5(oldpassword)&"'",conn,1,3
If rs.EOF Then
rs.Close
Set rs = Nothing
oblog.adderrstr ("错误:原密码输入错误!")
oblog.showusererr
Exit Sub
Else
If API_Enable Then
Dim blogAPI,j
Set blogAPI = New DPO_API_OBLOG
blogAPI.LoadXmlFile True
blogAPI.UserName=oblog.l_uName
blogAPI.PassWord=newpassword
Call blogAPI.ProcessMultiPing("update")
Set blogAPI=Nothing
For j=0 To UBound(aUrls)
strUrl=Lcase(aUrls(j))
If Left(strUrl,7)="http://" Then
Response.write("<script src="""&strUrl&"?syskey="&MD5(oblog.l_uName&oblog_Key)&"&username="&oblog.l_uName&"&password="&MD5(newpassword)&"&savecookie=0""></script>")
End If
Next
End If
rs("password") = md5(newpassword)
rs.Update
rs.Close
Set rs = Nothing
oblog.savecookie oblog.l_uname, MD5(newpassword), 0, ""
oblog.showok "修改密码成功,下次需要重新登录!", ""
End If
End Sub
Sub userinfo()
Dim rs
Set rs = oblog.execute("select * from oblog_user where userid=" & oblog.l_uid)
%>
<script language="javascript">
function getImg(){
if (document.oblogform.ico.value==""){
document.oblogform.imgIcon.src="images/ico_default.gif";
}
else{
document.oblogform.imgIcon.src=document.oblogform.ico.value;
}
}
</script>
<div id="dTab13" class="Box">
<form name="oblogform" action="user_setting.asp" method="post">
<table class="dTab13_body" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="dTab13_body_td">用户id:</td>
<td><span class="user_id"><%=rs("userName")%></span></td>
<td class="dTab13_body_td">等级</td>
<td class="userlevel"><font color=red><%=oblog.l_Group(1,0)%></font>
</td>
</tr>
<tr>
<td class="dTab13_body_td">选择头像:</td>
<td colspan="3"><div class="user_face"><img src="<%=Ob_IIF(rs("user_icon1"),"images/ico_default.gif")%>" id="imgIcon" width=<%=C_UserIcon_Width%> height=<%=C_UserIcon_Width%>>
只支持jpg、gif、png,小于50k,默认尺寸为48*48
<p><iframe id="d_file" frameborder="0" src="upload.asp?tMode=9&re=" width="300" height="60" scrolling="no"></iframe></p>
<p>图片地址:<input name="ico" type="text" value="<%=oblog.filt_html(rs("user_icon1"))%>" size="50" maxlength="200" onblur="getImg();"></p></div></td>
</tr>
<tr>
<td class="dTab13_body_td">昵称</td>
<td colspan="3"><input name="nickname" type="text" value="<%=oblog.filt_html(rs("nickname"))%>" size="30" maxlength="20" /><input type="hidden" name="o_nickname" value="<%=oblog.filt_html(rs("nickname"))%>" /></td>
</tr>
<tr>
<td class="dTab13_body_td">真实姓名</td>
<td><input name="truename" type="text" value="<%=oblog.filt_html(rs("truename"))%>" size="30" maxlength="20" /></td>
<td class="dTab13_body_td">性别</td>
<td><input type="radio" value="1" name="sex" <%if rs("Sex")=1 then response.write "checked"%> />
男 <input type="radio" value="0" name="sex" <%if rs("Sex")=0 then response.write "checked"%> />女</td>
</tr>
<tr>
<td class="dTab13_body_td">出生日期</td>
<td>
<input value="<%=year(rs("birthday"))%>" name="y" size="4" maxlength="4" />年
<input value="<%=month(rs("birthday"))%>" name="m" size="2" maxlength="2" />月
<input value="<%=day(rs("birthday"))%>" name="d" size="2" maxlength="2" />日
</td>
<td class="dTab13_body_td">省/市</td>
<td><%=oblog.type_city(rs("province"),rs("city"))%></td>
</tr>
<tr>
<td class="dTab13_body_td">职业</td>
<td><%oblog.type_job(rs("job"))%></td>
<td class="dTab13_body_td">Email</td>
<td><input name="Email" value="<%=oblog.filt_html(rs("userEmail"))%>" size="30" maxlength="50" /></td>
</tr>
<tr>
<td class="dTab13_body_td">主页</td>
<td colspan="3"><input maxlength="100" size="30" name="homepage" value="<%=oblog.filt_html(rs("Homepage"))%>" /></td>
</tr>
<tr>
<td class="dTab13_body_td">QQ号码</td>
<td><input name="qq" value="<%=oblog.filt_html(rs("qq"))%>" size="30" maxlength="20" /></td>
<td class="dTab13_body_td">MSN</td>
<td><input name="msn" value="<%=oblog.filt_html(rs("Msn"))%>" size="30" maxlength="50" /></td>
</tr>
<tr>
<td class="dTab13_body_td">电话</td>
<td><input name="tel" value="<%=oblog.filt_html(rs("tel"))%>" size="30" maxlength="50" /></td>
<td class="dTab13_body_td">通信地址</td>
<td><input name="address" value="<%=oblog.filt_html(rs("address"))%>" size="40" maxlength="250" /></td>
</tr>
<tr>
<td colspan="4" align="center"><input name="action" type="hidden" value="saveuserinfo" />
<input type="submit" value=" 更 新 " /></td>
</tr>
</table>
</form>
</div>
<%
Set rs = Nothing
End Sub
Sub saveuserinfo()
Dim rs, nickname, email, birthday,usericon
nickname = Trim(request("nickname"))
email = Trim(request("email"))
birthday = Trim(request("y")) & "-" & Trim(request("m")) & "-" & Trim(request("d"))
usericon=Trim(request("ico"))
'If oblog.chk_regname(nickname) Then oblog.adderrstr ("此昵称系统不允许注册!")
If oblog.chk_badword(nickname) > 0 Then oblog.adderrstr ("昵称中含有系统不允许的字符!")
If oblog.strLength(nickname) > 50 Then oblog.adderrstr ("昵称不能不能大于50字符!")
'昵称唯一性判断
If oblog.cacheConfig(47) = 1 And nickname <> "" And nickname <> Trim(request("o_nickname")) Then
Set rs = oblog.execute("select userid from oblog_user where nickname='" & oblog.filt_badstr(nickname) & "'")
If Not rs.EOF Or Not rs.bof Then oblog.adderrstr ("系统中已经有这个昵称存在,请更改昵称!")
End If
If birthday = "--" Then
birthday = ""
Else
If Not IsDate(birthday) Then oblog.adderrstr ("生日日期格式错误!")
If CLng(Trim(request("y"))) > 2060 Then oblog.adderrstr ("生日年份过大!")
If CLng(Trim(request("y"))) < 1900 Then oblog.adderrstr ("生日年份过小!")
End If
If email = "" Then oblog.adderrstr ("电子邮件地址不能为空!")
If Not oblog.IsValidEmail(email) Then oblog.adderrstr ("电子邮件地址格式错误!")
Dim rsreg
' If oblog.CacheConfig(47)="1" Then
' Set rsreg=oblog.execute("select Count(userid) From oblog_user Where nickname='" & nickname & "' and userid<>" & oblog.l_uid)
' If rsreg(0)>0 Then
' oblog.adderrstr ("您使用的昵称: " & nickname & " 已被他人使用,请更换其他昵称")
' End If
' rsreg.Close
' End If
Set rsreg=Nothing
If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
Set rs = server.CreateObject("adodb.recordset")
rs.open "select * from oblog_user where userid=" & oblog.l_uid, conn, 1, 3
If Not rs.EOF Then
If API_Enable Then
Dim blogAPI
Set blogAPI = New DPO_API_OBLOG
blogAPI.LoadXmlFile True
blogAPI.UserName=rs("UserName")
blogAPI.EMail=Email
blogAPI.Sex=clng(request("sex"))
blogAPI.QQ=oblog.filt_astr(request("qq"),20)
blogAPI.MSN=oblog.filt_astr(request("msn"),50)
blogAPI.truename=oblog.filt_astr(request("truename"),20)
If birthday <> "" Then blogAPI.birthday=birthday
blogAPI.telephone=oblog.filt_astr(request("tel"),50)
blogAPI.homepage=oblog.filt_astr(request("homepage"),100)
blogAPI.province=oblog.filt_astr(request("province"),18)
blogAPI.city=oblog.filt_astr(request("city"),18)
blogAPI.address=oblog.filt_astr(request("address"),250)
Call blogAPI.ProcessMultiPing("update")
Set blogAPI=Nothing
End If
rs("nickname") = oblog.filt_astr(nickname, 50)
rs("truename") = oblog.filt_astr(request("truename"), 20)
rs("sex") = CLng(request("sex"))
rs("province") = oblog.filt_astr(request("province"),20)
rs("city") = oblog.filt_astr(request("city"),20)
If birthday <> "" Then rs("birthday") = oblog.filt_astr(birthday,20)
rs("job") = oblog.filt_astr(request("job"),20)
rs("useremail") = oblog.filt_astr(email, 50)
rs("homepage") = oblog.filt_astr(request("homepage"), 100)
rs("qq") = oblog.filt_astr(request("qq"), 20)
rs("msn") = oblog.filt_astr(request("msn"), 50)
rs("tel") = oblog.filt_astr(request("tel"), 50)
rs("address") = oblog.filt_astr(request("address"), 250)
rs("user_icon1") = RemoveHtml(oblog.filt_html(oblog.filt_astr(request("ico"),200)))
rs.Update
rs.Close
End If
Set rs = Nothing
oblog.showok "保存资料成功!", ""
End Sub
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?