gusucode.com > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告) > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告)\13学生论坛ASPAC\BBS\modifyadd.asp

    <!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/chkinput.asp"-->
<%
Mybbs.LoadTemplates("Usermanager")
Mybbs.Stats=Mybbs.MemberName&template.Strings(3)
Mybbs.Nav()
Mybbs.Head_var 0,0,template.Strings(0),"Usermanager.asp"
Dim ErrCodes
If Mybbs.Userid=0 Then
	Mybbs.AddErrCode(6)
End If
If Cint(Mybbs.GroupSetting(16))=0 Then
	Mybbs.AddErrCode(28)
End If
Mybbs.Showerr()
Response.write template.html(0)
If request("action")="updat" Then
	Call update()
	If ErrCodes<>"" Then Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	Mybbs.Showerr()
	Mybbs.Dvbbs_Suc("<li>"+template.Strings(26))
Else
	Call Userinfo()
	Mybbs.Showerr()
End If
Mybbs.ActiveOnline()
Mybbs.Footer()

Sub userinfo()
	Dim Rs,Sql,tempstr,userim
	tempstr=template.html(10)
	sql="Select Userid,UserEmail,UserIM from [Dv_User] where Userid="&Mybbs.Userid
	Set Rs=Mybbs.Execute(Sql)
	If Rs.eof And Rs.bof Then
		Mybbs.AddErrCode(32)
		Exit Sub
	Else
		tempstr=Replace(tempstr,"{$user_id}",Rs(0))
		tempstr=Replace(tempstr,"{$user_email}",Rs(1)&"")
		If rs(2)="" or isnull(rs(2)) Then
			tempstr=Replace(tempstr,"{$user_homepage}","")
			tempstr=Replace(tempstr,"{$user_oicq}","")
			tempstr=Replace(tempstr,"{$user_icq}","")
			tempstr=Replace(tempstr,"{$user_Msn}","")
			tempstr=Replace(tempstr,"{$user_Yahoo}","")
			tempstr=Replace(tempstr,"{$user_Aim}","")
			tempstr=Replace(tempstr,"{$user_UC}","")
		Else
			userim=split(rs(2),"|||")
			tempstr=Replace(tempstr,"{$user_homepage}",userim(0))
			tempstr=Replace(tempstr,"{$user_oicq}",userim(1))
			tempstr=Replace(tempstr,"{$user_icq}",userim(2))
			tempstr=Replace(tempstr,"{$user_Msn}",userim(3))
			tempstr=Replace(tempstr,"{$user_Aim}",userim(4))
			tempstr=Replace(tempstr,"{$user_Yahoo}",userim(5))
			tempstr=Replace(tempstr,"{$user_UC}",userim(6))
		End If
		Response.write tempstr
	End If
	Rs.Close:Set Rs =Nothing
End sub

Sub update()
	Dim Rs,Sql
	Dim Email,NewUserIM
	If Mybbs.chkpost=False Then
		Mybbs.AddErrCode(16)
		Exit Sub
	End If
	Dim userpassword
	userpassword=Request.form("password")
	If userpassword="" Then
		Mybbs.AddErrCode(11)
		Exit Sub
	Else
		userpassword=md5(userpassword,16)	
	End If
	'校验密码,
	SQL="Select userpassword from dv_user where userid="&Mybbs.UserID&""
	
	Set Rs=Mybbs.Execute(SQL)
	If Not Rs.eof Then
		If Rs(0)<> userpassword Then
			Response.redirect "showerr.asp?ErrCodes=您输入的密码错误&action=OtherErr"
		End If
	Else
		Response.redirect "showerr.asp?ErrCodes=您输入的密码错误&action=OtherErr"
	End If
	Set rs=Nothing 
	If Not Mybbs.FoundIsChallenge Then
		If IsValidEmail(Request.form("Email"))=false Then
			ErrCodes=ErrCodes+"<li>"+template.Strings(31)		'Mybbs.AddErrmsg "您的Email有错误。"
			Exit Sub
		Else
			If Not IsNull(Mybbs.forum_setting(52)) And Mybbs.forum_setting(52)<>"" And Mybbs.forum_setting(52)<>"0" Then
				Dim SplitUserEmail,i
				SplitUserEmail=split(Mybbs.forum_setting(52),"|")
				For i=0 to ubound(SplitUserEmail)
					If instr(Request.form("email"),SplitUserEmail(i))>0 Then
						ErrCodes=ErrCodes+"<li>"+template.Strings(32)		'Mybbs.AddErrmsg "您填写的Email地址含有系统禁止字符。"
						Exit Sub
					End If
				Next
			End If
			Email=Mybbs.checkstr(Request.form("Email"))
		End If
	Else
		Email=Mybbs.checkstr(Request.form("Email"))
	End If
	If Request.form("Oicq")<>"" Then
		If Not isnumeric(Request.form("Oicq")) or len(Request.form("Oicq"))>12 Then
			Mybbs.AddErrCode(18)
			Exit Sub
		End If
	End If
	'HomePage,UserOicq,UserIcq,UserMsn,UserAim,UserYahoo,UserUC
	NewUserIM=Request.form("homepage") &"|||"& Request.form("Oicq") &"|||"& Request.form("Icq") &"|||"& Request.form("Msn") &"|||"& Request.form("Yahoo") &"|||"& Request.form("UserAim") &"|||"& Request.form("UC")
	NewUserIM=Mybbs.checkstr(NewUserIM)
	'update data
	sql="update [Dv_User] set UserEmail='"&Email&"',UserIM='"&NewUserIM&"' where Userid="&Mybbs.Userid
	Set Rs=Mybbs.Execute(Sql)
End Sub
%>