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

📄 cl_clssystem.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 5 页
字号:
			If Not (Prs.Bof And Prs.Eof) then
				sPPath=Split(Prs(0) & "," & sClassID,",")
				For n=1 to Ubound(sPPath)
					If Instr(","&sarrClassID&",",","&sPPath(n)&",")>0 then
						IsTrueSchoolUser=True : Exit For
					End if
					if n>=20 then Exit For
				Next
			End if
			Set Prs=Nothing
		end if
	End Function
	Public Function GetCookies(sName)
		GetCookies=Trim(Request.Cookies(Web_Cookies)(sName))
	End Function
	Public Sub SetCookies(sName,sValue)
		Response.Cookies(Web_Cookies)(sName)=Trim(sValue)
	End Sub
	Public Sub EmptyCookies()
		Response.Cookies(Web_Cookies)("UserID")			= Empty
		Response.Cookies(Web_Cookies)("UserName")		= Empty
		Response.Cookies(Web_Cookies)("Password")		= Empty
		Response.Cookies(Web_Cookies)("UserGroupID")	= Empty
	'	Response.Cookies(Web_Cookies)("TruePassWord")	= Empty
		Response.Cookies(Web_Cookies & "Kill")("kill")	= Empty
		Response.Cookies(Web_Cookies)					= Empty
		Session(CacheName & "UserID")					= Empty
	End Sub
	'更新用户资料
	Public Sub NewUserInfo(Number,strData)
		if not isnumeric(Number) then Exit Sub
		Dim str_Info
		str_Info=Session(CacheName & "UserID")
		If Not IsArray(str_Info) Then Exit Sub
		if Ubound(str_Info)<28 then Exit Sub
		str_Info(Cint(Number))=Trim(strData)
		Session(CacheName & "UserID")=str_Info
	End Sub
	Public Sub NeedUpdateList(username,act)
		Dim Tmpstr,TmpUsername
		Name="NeedToUpdate"
		If ObjIsEmpty() Then Value=""
		Tmpstr=Value
		TmpUsername=","&username&","
		Tmpstr=Replace(Tmpstr,TmpUsername,",")
		Tmpstr=Replace(Tmpstr,",,",",")
		IF act=1 Then 
			'If IsONline(username,0) Then
				If Tmpstr="" Then
					Tmpstr=TmpUsername
				Else
					Tmpstr=Tmpstr&TmpUsername
				End If
			'End If
		End If
		Tmpstr=Replace(Tmpstr,",,",",")
		Value=Tmpstr
	End Sub
	'系统分配随机密码
	Public Function Createpass(Byval LengthNum)
		Dim Ran,i
		if Not IsNumeric(LengthNum) then LengthNum=16
		Createpass=""
		For i=1 To LengthNum
			Randomize
			Ran = CInt(Rnd * 2)
			Randomize
			Select Case Ran
			Case 0
				Ran = CInt(Rnd * 25) + 97
				Createpass =Createpass& UCase(Chr(Ran))
			Case 1
				Ran = CInt(Rnd * 9)
				Createpass = Createpass & Ran
			Case 2
				Ran = CInt(Rnd * 25) + 97
				Createpass =Createpass& Chr(Ran)
			End Select
		Next
	End Function
	Public Function GetUserSex(strSex)
		Select Case GetClng(strSex)
		Case 0 : GetUserSex="女"
		Case 1 : GetUserSex="男"
		Case Else : GetUserSex="保密"
		End Select
	End Function
	Public Function GetPaymentName(Byval str)
		Select Case GetClng(str)
		Case 0 : GetPaymentName="账户支付"
		Case 1 : GetPaymentName="在线支付"
		Case 2 : GetPaymentName="银行汇款"
		Case 3 : GetPaymentName="邮政汇款"
		Case Else : GetPaymentName="其它支付"
		End Select
	End Function
	'检查用户权限
	Public Function ChkUserGroupID(Byval sPurview,Byval sLevel)
		ChkUserGroupID=False
		if Instr(","&sPurview&",",",5,")>0 then
			ChkUserGroupID=True : Exit Function
		end if
		if Instr(","&sPurview&",",","&sLevel&",")>0 then ChkUserGroupID=True
	End Function
	'======================================================
	'sPurview-----1(Master),2(Check),3(Input)
	'======================================================
	Public Function TrueChannelPurview(Byval sPurview,Byval sChannelID)
		TrueChannelPurview = True
		If Cint(Admin_Purview(0)) = 1 Then Exit Function
		If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) then
			TrueChannelPurview = False : Exit Function
		end if
		If Ubound(Admin_Purview) < sChannelID Then
			TrueChannelPurview = False : Exit Function
		Else
			if Cint(Admin_Purview(sChannelID)) <= sPurview Then Exit Function
		End if
		TrueChannelPurview = False
	End Function

	Public Function TrueClassMaster(Byval sMaster,Byval sName)
		TrueClassMaster = True
		If Cint(Admin_Purview(0)) = 1 Then Exit Function
		if Instr("|" & sMaster & "|","|" & sName & "|")>0 then Exit Function
		TrueClassMaster = False
	End Function

	Public Function TrueArrClassPurview(Byval sPurview,Byval sChannelID,Byval sArrID)
		TrueArrClassPurview = False
		Dim ii,sArr
		sArr = Split(sArrID,",")
		for ii=1 to Ubound(sArr)
			TrueArrClassPurview = TrueClassPurview(sPurview,sChannelID,sArr(i))
			if TrueArrClassPurview = True Then Exit For
		Next
	End Function

	Public Function TrueClassPurview(Byval sPurview,Byval sChannelID,Byval sClassID)
		TrueClassPurview = True
		If Cint(Admin_Purview(0)) = 1 Then Exit Function
		If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) or Not IsNumeric(sClassID) then
			TrueClassPurview = False : Exit Function
		end if
		If Ubound(Admin_Purview) < sChannelID Then
			TrueClassPurview = False : Exit Function
		Else
			if Cint(Admin_Purview(sChannelID)) < 3 Then Exit Function
			if Cint(Admin_Purview(sChannelID)) >= 4 Then TrueClassPurview = False : Exit Function
		End if
		if Instr(","&Admin_Info(5)&",",","&sClassID&",")>0 Then
			Exit Function
		ElseIf sPurview <= 1 Then
			TrueClassPurview = False : Exit Function
		End If
		If Instr(","&Admin_Info(6)&",",","&sClassID&",")>0 Then
			Exit Function
		ElseIf sPurview <= 2 Then
			TrueClassPurview = False : Exit Function
		End If
		If Instr(","&Admin_Info(7)&",",","&sClassID&",")>0 Then
			Exit Function
		End IF
		TrueClassPurview = False
	End Function

	Public Function TrueOtherPurview(Byval sPurview)
		TrueOtherPurview = True
		If Cint(Admin_Purview(0)) = 1 Then Exit Function
		if Instr("," & Lcase(Admin_Info(4)) & ",","," & Lcase(sPurview) & ",")>0 then Exit Function
		TrueOtherPurview = False
	End Function

	'======================================================
	'User:sPurview-----1(Master),2(Check),3(Input),4(View)
	'======================================================
	Public Function TrueChannelPurview_U(Byval sPurview,Byval sChannelID)
		TrueChannelPurview_U = True
		if UserID=0 or UserGroupID=5 then TrueChannelPurview_U = False : Exit Function
		If Cint(User_Purview(0)) = 1 Then Exit Function
		If Cint(User_Purview(0)) > 2 Then TrueChannelPurview_U = False : Exit Function
		If Ubound(User_Purview) < sChannelID Then TrueChannelPurview_U = False : Exit Function
		if Cint(User_Purview(sChannelID)) <= sPurview Then Exit Function
		TrueChannelPurview_U = False
	End Function

	Public Function TrueClassPurview_U(Byval sPurview,Byval sChannelID,Byval sClassID)
		TrueClassPurview_U = True
		if UserID=0 or UserGroupID=5 then TrueClassPurview_U = False : Exit Function
		If Cint(User_Purview(0)) = 1 Then Exit Function
		If Cint(User_Purview(0)) > 2 Then TrueClassPurview_U = False : Exit Function
		If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) or Not IsNumeric(sClassID) then
			TrueClassPurview_U = False : Exit Function
		end if
		If Ubound(User_Purview) < sChannelID Then TrueClassPurview_U = False : Exit Function
		Select Case Cint(User_Purview(sChannelID))
		Case 1
			Exit Function
		Case 2
			If sPurview >= 2 Then Exit Function
		Case 3
			If Instr(","&User_Group.SelectSingleNode("@arrclassmaster").text&",",","&sClassID&",")>0 Then
				TrueClassPurview_U = True : Exit Function
			ElseIf sPurview <= 1 Then
				TrueClassPurview_U = False : Exit Function
			End If
			If Instr(","&User_Group.SelectSingleNode("@arrclasscheck").text&",",","&sClassID&",")>0 Then
				Exit Function
			ElseIf sPurview <= 2 Then
				TrueClassPurview_U = False : Exit Function
			End If
			If Instr(","&User_Group.SelectSingleNode("@arrclassinput").text&",",","&sClassID&",")>0 Then
				Exit Function
			ElseIf sPurview <= 3 Then
				TrueClassPurview_U = False : Exit Function
			End If
			If Instr(","&User_Group.SelectSingleNode("@arrclassview").text&",",","&sClassID&",")>0 Then
				Exit Function
			End IF
		Case 4, 5
			If sPurview >= 3 Then Exit Function
		Case 6
			If sPurview >= 4 Then Exit Function
		End Select
		TrueClassPurview_U = False
	End Function

	Public Function TrueOtherPurview_U(Byval sPurview)
		TrueOtherPurview_U = True
		if UserID=0 or UserGroupID=5 then TrueOtherPurview_U = False : Exit Function
		If Cint(User_Purview(0)) = 1 Then Exit Function
		if Instr("," & Lcase(User_Group.SelectSingleNode("@purview_other").text) & ",","," & Lcase(sPurview) & ",")>0 then Exit Function
		TrueOtherPurview_U = False
	End Function

	Public Function TrueBrowsePurview()
		TrueBrowsePurview=False
		Select Case BrowsePurview
		Case 0 : TrueBrowsePurview=True
		Case 1
			if TrueChannelPurview_U(1,ChannelID) then
				TrueBrowsePurview=True
			else
				Dim sTr,i
				sTr=Split(ParentPath & "," & ClassID,",")
				for i=1 to Ubound(sTr)
				TrueBrowsePurview=TrueClassPurview_U(4,ChannelID,sTr(i))
				if TrueBrowsePurview=True then Exit For
				Next
			end if
		Case 2
			if Instr("|"&VipUser&"|","|"&MemberName&"|")>0 or UserGroupID=1 then
				TrueBrowsePurview=True
			end if
		End Select
	End Function

	Public Function TrueInfoPurview()
		TrueInfoPurview = False
		if Not TrueBrowsePurview then
			ErrMessage = Language.selectSingleNode("//ClassNoPurview").text
			Exit Function
		end If
		Dim sEditor, sInfoGroup, sInfoPoint, sInfoMoney
		Dim sBackPoint, sBackPointRate, sBackMoney, sBackMoneyRate
		Dim tRs, tSQL, IsPay
		Dim sUserPoint, sUserMoney
		sEditor			= Rs("Editor")
		sInfoGroup		= Rs("InfoGroup")
		sInfoPoint		= Rs("InfoPoint")
		sInfoMoney		= Rs("InfoMoney")
		sBackPoint		= Rs("BackPoint")
		sBackPointRate	= Rs("BackPointRate")
		sBackMoney		= Rs("BackMoney")
		sBackMoneyRate	= Rs("BackMoneyRate")
		if ChkUserGroupID(sInfoGroup,5) and sInfoPoint=0 and sInfoMoney=0 Then
			TrueInfoPurview = True : Exit Function
		End if
		If UserID=0 or UserGroupID=5 then
			ErrMessage = ReplaceDir(Language.selectSingleNode("//NoLoginErr").text)
			Exit Function
		End if
		if Not ChkUserGroupID(sInfoGroup,UserGroupID) Then
			ErrMessage = Language.selectSingleNode("//NoPurviewErr").text
			ErrMessage = Replace(ErrMessage,"{$usergroup}",GetUserGroupName(sInfoGroup))
			Exit Function
		End if
		Rem 即时取得用户点数和金钱
		tSQL="Select top 1 "&Db.UserPoint&","&Db.UserMoney&" From "&Db.UserTable&" Where "&Db.UserID&"="&UserID
		Set tRs=Execute_U(tSQL)
		if tRs.Bof and tRs.Eof Then
			tRs.Close : Set tRs=Nothing
			ErrMessage = Language.selectSingleNode("//UserNoFind").text
			Exit Function
		End if
		sUserPoint = tRs(0)
		sUserMoney = tRs(1)
		tRs.Close : Set tRs=Nothing
		Rem End
		tSQL="Select Top 1 ID,ConsumePoint,ConsumeMoney,ConsumeNums,ConsumeLog,ConsumeTime From Cl_ConsumeLog Where UserID="&UserID&" and InfoID="&InfoID&" and ChannelID="&ChannelID&" Order By ID Desc"
		Set tRs=Server.CreateObject("adodb.recordset")
		OpenConn_L : tRs.Open tSQL,Conn_L,1,3

⌨️ 快捷键说明

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