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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 (v3.4.03) BUG+FIX: search.asp (passworded forums)
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GauravBhabu
Advanced Member

4288 Posts

Posted - 23 October 2002 :  11:18:28  Show Profile
search.asp
Lines 138-217
I am not aware if this has already been addressed somewhere else. Please excuse me for bringing it up if this has been already mentioned earlier.
Lines 185 and 195
select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & Forum_Subject)

Above statement refers to variable Forum_Subject to get the information from cookies. But it is initialized nowhere. It seems that intention is to get the Forum_Subject information from the DB. However the Forum subject column is not retrieved from the DB. Following is sql used to get the information from database.

Lines 141-144
allowSql = "SELECT FORUM_ID, F_PRIVATEFORUMS, F_PASSWORD_NEW"
	allowSql = allowSql & " FROM " & strTablePrefix & "FORUM"
	allowSql = allowSql & " WHERE F_TYPE = 0"
	allowSql = allowSql & " ORDER BY FORUM_ID"


IMO, for the code to work as intended, column F_SUBJECT should be added to the sql statement and variable Forum_Subject should be initialized along with other variables (requires changes around lines 160-162 and 166-168).

Code between Lines 138-217 with required changes in red.
Note: some statements are modified to avoid scrolling
if strPrivateForums = "1" and mLev < 4 then
  allAllowedForums = ""

  allowSql = "SELECT FORUM_ID, F_SUBJECT, F_PRIVATEFORUMS, F_PASSWORD_NEW"
  allowSql = allowSql & " FROM " & strTablePrefix & "FORUM"
  allowSql = allowSql & " WHERE F_TYPE = 0"
  allowSql = allowSql & " ORDER BY FORUM_ID"

  set rsAllowed = Server.CreateObject("ADODB.Recordset")
  rsAllowed.open allowSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

  if rsAllowed.EOF then
   recAllowedCount = ""
  else
   allAllowedData = rsAllowed.GetRows(adGetRowsRest)
   recAllowedCount = UBound(allAllowedData,2)
  end if

  rsAllowed.close
  set rsAllowed = nothing

  if recAllowedCount <> "" then
   fFORUM_ID = 0
   fF_SUBJECT = 1
   fF_PRIVATEFORUMS = 2
   fF_PASSWORD_NEW = 3

  for RowCount = 0 to recAllowedCount

    Forum_ID = allAllowedData(fFORUM_ID,RowCount)
    Forum_Subject = allAllowedData(fF_SUBJECT,RowCount)
    Forum_PrivateForums = allAllowedData(fF_PRIVATEFORUMS,RowCount)
    Forum_FPasswordNew = allAllowedData(fF_PASSWORD_NEW,RowCount)
    if mLev = 4 then
     ModerateAllowed = "Y"
    elseif mLev = 3 and ModOfForums <> "" then
     if (strAuthType = "nt") then
      if (chkForumModerator(Forum_ID, Session(strCookieURL & "username")) = "1") then 
       ModerateAllowed = "Y" 
      else 
       ModerateAllowed = "N"
      end if
     else 
      if (instr("," & ModOfForums & "," ,"," & Forum_ID & ",") > 0) then 
       ModerateAllowed = "Y" 
      else 
       ModerateAllowed = "N"
      end if
     end if
    else
     ModerateAllowed = "N"
    end if
    if ChkDisplayForum(Forum_PrivateForums,Forum_FPasswordNew,Forum_ID,MemberID) = true then
     canView = true
     select case Forum_PrivateForums
      case 2 '## password
       select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & Forum_Subject)
        case Forum_FPasswordNew
         canView = true
        case else
         canView = false
       end select
      case 3,7 '## Either Password or Allowed Member(already covered)/Member
       if MemberID > 0 then
        canView = true
       else
        select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & Forum_Subject)
         case Forum_FPasswordNew
          canView = true
         case else
          canView = false
        end select
       end if
      case else
       canView = true
     end select
     if canView then
      if allAllowedForums = "" then
       allAllowedForums = Forum_ID
      else
       allAllowedForums = allAllowedForums & "," & Forum_ID
      end if
     end if
    end if
  next
  end if
  if allAllowedForums = "" then allAllowedForums = 0
  'Response.Write allAllowedForums
end if

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 17 June 2003 :  07:56:00  Show Profile
fixed in v3.4.04
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07