⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inc_func_secure.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 2 页
字号:
										if strSetCookieToForum = 1 then
											Response.Cookies(strUniqueID & "Forum").Path = strCookieURL
										end if
										Response.Cookies(strUniqueID & "Forum")("PRIVATE_" & rsStatus("F_SUBJECT")) = Request("pass")
										chkForumAccess = true
									end if
								end if
						end select
					end if
				'## code added 07/13/2000
				case 7 '## members or password
					if strDBNTUserName = "" then
						select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & rsStatus("F_SUBJECT"))
							case rsStatus("F_PASSWORD_NEW")
								chkForumAccess = true
							case else
								if Request("pass") = "" then
									if Display then
										doLoginForm
										response.end
									else
										chkForumAccess = false
									end if
								else
									if Request("pass") <> rsStatus("F_PASSWORD_NEW") then
										if Display then
											Response.Write 	"      <p align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Invalid password!</b></p>" & vbNewLine & _
													"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back to Enter Data</a></font></p><br />" & vbNewLine
											WriteFooter
											Response.End
										else
											chkForumAccess = false
										end if
									else
										if strSetCookieToForum = 1 then
											Response.Cookies(strUniqueID & "Forum").Path = strCookieURL
										end if
										Response.Cookies(strUniqueID & "Forum")("PRIVATE_" & rsStatus("F_SUBJECT")) = Request("pass")
										chkForumAccess = true
									end if
								end if
						end select
					else
			                        chkForumAccess = true
					end if
					'## end code added 07/13/2000
					
				case 4, 5 '## members only
					if Usernum = -1 or Usernum = "" then
						if Display then
							doNotLoggedInForm
						else
							chkForumAccess = false
						end if
					else '## V3.1 SR4
						chkForumAccess = true
					end if

				case 8, 9
					test="test db"
					chkForumAccess = FALSE
					if strAuthType="db" then
						chkForumAccess = true
						rsStatus.close
						set rsStatus = nothing
						exit function
					end if
					NTGroupSTR = Split(Session(strCookieURL & "strNTGroupsSTR"), ", ")
					for j = 0 to ubound(NTGroupSTR)
						NTGroupDBSTR = Split(rsStatus("F_PASSWORD_NEW"), ", ")
						for i = 0 to ubound(NTGroupDBSTR)
							if NTGroupDBSTR(i) = NTGroupSTR(j) then
								chkForumAccess = True
								rsStatus.close
								set rsStatus = nothing
								exit function
							end if
						next
					next
					if Display then
						doNotAllowed
					end if
				case else
					chkForumAccess = true
			end select
		else
			chkForumAccess = true
		end if
	end if

	rsStatus.close
	set rsStatus = nothing
end function


function chkForumAccessNew(fPrivateForums,fFPasswordNew,fForum_Subject,fForum_ID,UserNum)
	if MemberID = UserNum then
		if mLev < 1 then
			chkForumAccessNew = false
		elseif mLev = 3 then
			chkForumAccessNew = true
		elseif mLev = 4 then
			chkForumAccessNew = true
			exit function
		end if
	end if

	dim Users
	dim MatchFound

	Select case fPrivateForums
		case 0
			chkForumAccessNew = true
		case 1, 6 '## Allowed Members List
			if isAllowedMember(fForum_ID,UserNum) = 1 then
				chkForumAccessNew = true
			else
				chkForumAccessNew = false
			end if
		case 2 '## password
			select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & fForum_Subject)
				case fFPasswordNew
					chkForumAccessNew = true
				case else
					chkForumAccessNew = false
			end select
		case 3 '## Either Password or Allowed Members List
			if isAllowedMember(fForum_ID,UserNum) = 1 then
				chkForumAccessNew = true
			else
				chkForumAccessNew = false
			end if
			if not(chkForumAccessNew) then 
				select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & fForum_Subject)
					case fFPasswordNew
						chkForumAccessNew = true
					case else
						chkForumAccessNew = false
				end select
			end if
		case 7 '## Members or Password
			if Usernum = -1 or Usernum = "" then
				select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & fForum_Subject)
					case fFPasswordNew
						chkForumAccessNew = true
					case else
						chkForumAccessNew = false
				end select
			else
	                        chkForumAccessNew = true
			end if
			
		case 4, 5 '## Members only
			if Usernum = -1 or Usernum = "" then
				chkForumAccessNew = false
			else
				chkForumAccessNew = true
			end if
		case 8, 9 '## NT Global Groups
			test="test db"
			chkForumAccessNew = false
			if strAuthType="db" then
				chkForumAccessNew = true
			end if
			NTGroupSTR = Split(Session(strCookieURL & "strNTGroupsSTR"), ", ")
			for j = 0 to ubound(NTGroupSTR)
				NTGroupDBSTR = Split(fFPasswordNew, ", ")
				for i = 0 to ubound(NTGroupDBSTR)
					if NTGroupDBSTR(i) = NTGroupSTR(j) then
						chkForumAccessNew = True
						exit function
					end if
				next
			next
		case else
			chkForumAccessNew = true
	end select
end function


sub doLoginForm()
	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>You do not have access to this forum.</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>If you have been given special permission by the administrator to view and/or post in this forum, enter the password here:</font>" & vbNewLine & _
			"      <form action=""" & Request.ServerVariables("SCRIPT_NAME") & """ method=""post"" id=""form2"" name=""form2"">"
	for each q in Request.QueryString
		Response.Write "      <input type=""hidden"" name=""" & q & """ value=""" & Request(q) & """>" & vbNewLine
	next
	Response.Write	"        <table align=""center"" border=""0"">" & vbNewLine & _
			"          <tr>" & vbNewLine & _
			"            <td>" & vbNewLine & _
			"            <input name=""pass"" type=""password"" size=""25"">" & vbNewLine & _
			"            <input type=""submit"" value=""Enter"" id=""submit2"" name=""submit2"">" & vbNewLine & _
			"            </td>" & vbNewLine & _
			"          </tr>" & vbNewLine & _
			"        </table>" & vbNewLine & _
			"      </form></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Return to the forum</a></font></p><br />" & vbNewLine
	WriteFooter
	Response.End
end sub


sub doNotAllowed()
	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>You do not have access to this forum.</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back</a></font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Return to the forum</a></font></p><br />" & vbNewLine
	WriteFooter
	Response.End
end sub


sub doPasswordForm()
	if Request.QueryString <> "" then strRqQryString = "?" & Request.QueryString else strRqQryString = ""
	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>You must enter the password for this forum.</font>" & vbNewLine & _
			"      <form action=""" & Request.ServerVariables("SCRIPT_NAME") & strRqQryString & """ method=""post"" id=""form2"" name=""form2"">" & vbNewLine
	for each q in Request.QueryString
		Response.Write "      <input type=""hidden"" name=""" & q & """ value=""" & Request(q) & """>" & vbNewLine
	next
	Response.Write	"      <input name=""pass"" type=""password"" size=""25"">" & vbNewLine & _
			"      <input type=""submit"" value=""Enter"" id=""submit1"" name=""submit1"">" & vbNewLine & _
			"      </form></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back</a></font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Return to the forum</a></font></p><br />" & vbNewLine
	WriteFooter
	Response.End
end sub


sub doNotLoggedInForm()
	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>You must be logged in to enter this forum</font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back</a></font></p>" & vbNewLine & _
			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Return to the forum</a></font></p><br />" & vbNewLine
	WriteFooter
	Response.End
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -