Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Private Forums for Admins....Need a Little Help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

adamch25
Starting Member

USA
22 Posts

Posted - 17 July 2001 :  02:18:50  Show Profile  Send adamch25 an AOL message  Send adamch25 an ICQ Message  Send adamch25 a Yahoo! Message
I am trying to make the forums on my Message Board password protected even for admins. Normally if you password protect a forum, admins still have access to that forum. To get around this, I have modified the following code by commenting out the first few lines (skips check for admin status). This works and makes it so that ALL users have to login. The only problem I have now is that the cookies are being dropped for all user types. I have tested this with and without the modified code, and the cookie is still being dropped and the user is logged out when they return to the Message Board. Any help or insight would be appreciated.

'##############################################
'## Private Forums ##
'##############################################

sub chkUser4()

'if mLev = 4 then
'exit sub
'end if


'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "FORUM.F_PRIVATEFORUMS, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.F_PASSWORD_NEW "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.Forum_ID = " & Request.QueryString("FORUM_ID")

set rsStatus = my_conn.Execute (strSql)

dim Users
If cint(rsStatus("F_PRIVATEFORUMS")) <> 0 then

Select case cint(rsStatus("F_PRIVATEFORUMS"))
case 0
'## Do Nothing
case 1, 6 '## Allowed Users
UserNum = getNewMemberNumber()
MatchFound = isAllowedMember(Request.QueryString("FORUM_ID"), cint(UserNum))
if MatchFound then
exit sub
else
doNotAllowed
Response.end
end if
case 2 '## password
select case Request.Cookies(strUniqueID & "User")("PRIVATE_" & rsStatus("F_SUBJECT"))
case rsStatus("F_PASSWORD_NEW")
'## OK
case else
if Request("pass") = "" then
doPasswordForm
Response.End
else
if Request("pass") <> rsStatus("F_PASSWORD_NEW") then
Response.Write "Invalid password! <a href='" & Request.ServerVariables("HTTP_REFERER") & "'>Back</a>"
Response.End
else
if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
end if
Response.Cookies(strUniqueID & "User")("PRIVATE_" & rsStatus("F_SUBJECT")) = Request("pass")
end if
end if
end select
case 3 '## Either Password or Allowed
UserNum = getNewMemberNumber()
MatchFound = isAllowedMember(Request.QueryString("FORUM_ID"), cint(UserNum))
if MatchFound then
exit sub
else
select case Request.Cookies(strUniqueID & "User")("PRIVATE_" & rsStatus("F_SUBJECT"))
case rsStatus("F_PASSWORD_NEW")
'## OK
case else
if Request("pass") = "" then
doLoginForm
Response.End
else
if Request("pass") <> rsStatus("F_PASSWORD_NEW") then
Response.Write "Invalid password! <a href='" & Request.ServerVariables("HTTP_REFERER") & "'>Back</a>"
Response.End
else
if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
end if
Response.Cookies(strUniqueID & "User")("PRIVATE_" & rsStatus("F_SUBJECT")) = Request("pass")
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 & "User")("PRIVATE_" & rsStatus("F_SUBJECT"))
case rsStatus("F_PASSWORD_NEW")
'## OK
case else
if Request("pass") = "" then
doLoginForm
Response.End
else
if Request("pass") <> rsStatus("F_PASSWORD_NEW") then
Response.Write "Invalid password! <a href='" & Request.ServerVariables("HTTP_REFERER") & "'>Back</a>"
Response.End
else
if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
end if
Response.Cookies(strUniqueID & "User")("PRIVATE_" & rsStatus("F_SUBJECT")) = Request("pass")
end if
end if
end select
end if
'## end code added 07/13/2000
case 4, 5 '## members only
if strDBNTUserName = "" then
doNotLoggedInForm
end if
case 8, 9
NTGroupSTR = Split(strNTGroupsSTR, ", ")
NTGroupDBSTR = Split(rsStatus("F_PASSWORD_NEW"), ", ")
For i = 0 to ubound(NTGroupDBSTR)
for j = 0 to ubound(NTGroupSTR)
if NTGroupDBSTR(i) = NTGroupSTR(j) then
exit SUB
end if
next
next
doNotAllowed
Response.end

case else
Response.Write "<BR>ERROR: Invalid forum type: " & rsStatus("F_PRIVATEFORUMS")
Response.end
end select
end if

'my_Conn.Close
'set my_Conn = nothing

end sub


Edited by - adamch25 on 17 July 2001 02:21:20

adamch25
Starting Member

USA
22 Posts

Posted - 17 July 2001 :  02:25:31  Show Profile  Send adamch25 an AOL message  Send adamch25 an ICQ Message  Send adamch25 a Yahoo! Message
Here is also the code that sets the cookie:

'##############################################
'## Cookie functions and Subs ##
'##############################################

sub DoCookies(fSavePassWord)
if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
else
Response.Cookies(strUniqueID & "User").Path = "/"
end if
Response.Cookies(strUniqueID & "User")("Name") = strDBNTFUserName
Response.Cookies(strUniqueID & "User")("Pword") = Request.Form("Password")
Response.Cookies(strUniqueID & "User")("Cookies") = Request.Form("Cookies")
if fSavePassWord = "true" then
Response.Cookies(strUniqueID & "User").Expires = dateAdd("d", 30, strForumTimeAdjust)
end if
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTFUserName)
end sub


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07