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 (Open)
 Moderation and Last Post Updates
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  11:55:27  Show Profile  Visit SiSL's Homepage  Reply with Quote
Greetings,

Here is a bug found in latest version (including current boards), my board was 3.4.05 and it also has this... So I think it covers all versions...

1. Post a Topic to a Moderated Forum as normal user (like me)...

It does not show on "default.asp" as "Last Post" (so far so good). It does not update Last Topic / Last Reply / Last Post on Forum table...

2. Now "update" this topic (without being approved by mod) and then logout...

Voila, now it shows as "new topic" on default.asp (Board listing) and also updates "FORUM_FORUM" as last post...

3. Now delete this post... No, it still shows as latest post on board listings...


I did a testing on Announcements here, showing my post as last post... So I'm not familiar with a lot on post post options, so help me out here...


CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 12:03:29

HuwR
Forum Admin

United Kingdom
20563 Posts

Posted - 19 January 2011 :  12:05:45  Show Profile  Visit HuwR's Homepage
While not exactly the same issue, I would imagine this is related to the following issue http://forum.snitz.com/forum/topic.asp?TOPIC_ID=68291

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  12:33:34  Show Profile  Visit SiSL's Homepage
Indeed it is not really same thing...

One is about "already approved post not updating" (which might also may be the real cause of this bug -- that fix I also already applied) that, indeed, that one is about "UNapproved post updating while it should not after edit"

However, as you posted, that might be related too

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 16:46:19
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  17:15:38  Show Profile  Visit SiSL's Homepage
Okay, here what looks to me suspicious: post_info.asp Line 652


		        	if Moderation = "No" or Topic_Status < 2 then
					'## Forum_SQL - Update count of replies to a topic in Forum table

					strSql = "UPDATE " & strTablePrefix & "FORUM SET "
					strSql = strSql & " F_COUNT = F_COUNT - " & intResetCount
					strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
					my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

					'## Forum_SQL
					strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
					strSql = strSql & " F_TOPICS = F_TOPICS - 1 "
					strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
					my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

				end if 

				strSql = "UPDATE " & strTablePrefix & "FORUM SET "
				'if strLast_Post <> "" then 
					strSql = strSql & "F_LAST_POST = '" & strLast_Post & "'"
					'if strLast_Post_Author <> "" then 
						strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
					'end if
				'end if
				strSql = strSql & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
				strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
				strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
				my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords


Should Red part be inside previous end if or should we write another End if for various scenerios?

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 17:26:26
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  17:34:11  Show Profile  Send ruirib a Yahoo! Message
That piece of code seems to be related to topic moves. It won't solve your issue. It would look like it should be inside the If statement, though.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  17:37:17  Show Profile  Visit SiSL's Homepage
quote:
Originally posted by ruirib

That piece of code seems to be related to topic moves. It won't solve your issue. It would look like it should be inside the If statement, though.



Well, EditTopic in the end causing the problem. I mean it happens after editing unapproved topic. So yes, moving topic seems the same way... Should be another if there... but how...

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  18:26:21  Show Profile  Send ruirib a Yahoo! Message
I'm not finding where it's done for a simple edit that does not involve forum moving. Did your test posts involve moving the post to a different forum?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  19:13:05  Show Profile  Visit SiSL's Homepage
Actually Topic move of an unapproved topic to another Moderation=1 without changing forum stats and as unapproved works good... It may be something wrong with stuff that checks if it is topic move or not...

After moving topic when I edit unapproved topic again, it does very same as normal user...

Yeah, you are right, all stuff seems to be for topic move...

Now wondering if procedure for checking if topic move or not is missing some trigger or not...

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 19:35:56
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  19:38:47  Show Profile  Send ruirib a Yahoo! Message
I'm probably missing something, but I can't find the spot in the code where the forum changes are being made for a non moderated topic.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  19:57:33  Show Profile  Visit SiSL's Homepage
Tried differend "Response.Write "here" / Response.End to check out where it does that...


if mLev <> 4 and Moderation = "No" then
--> it passes this one... (Line 736)
'## Forum_SQL - Update Last Post
strSql = " UPDATE " & strTablePrefix & "FORUM"

And it takes Moderation as "No" instead of "Yes"... At some point of code, Moderation turns back to "No" or never changes...


CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  20:06:14  Show Profile  Send ruirib a Yahoo! Message
Problem is around line 500, in these two lines:


AutoApprove = "No"
Moderation = "No"


This because moderation is then checked, but only for topic moves. Moderation is never checked for topics that aren't moved.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  20:08:01  Show Profile  Visit SiSL's Homepage
So fix is easy then, check if Moderation still there...even without topic move... Ofcourse I wonder if it is necessary to "recheck" topic status if already approved or not...

Like changing it as if mLev < 4 and Moderation = "No" and Topic_Status < 2 then

EDIT: Oh and voila, that fixes it, now time to address rest of issues that might be effected...

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 20:11:46
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  20:10:50  Show Profile  Send ruirib a Yahoo! Message
Probably if you change the code in this area to this:


		'## if the forum we are moving to doesn't have MODERATION, and this topic did have that
		'## we are going to have to auto-approve the topic !

		
		if Forum_ID <> cLng(aryForum(1)) then
			blnTopicMoved = True

			AutoApprove = "No"
   		        Moderation = "No"

			strSql = "SELECT " & strTablePrefix & "FORUM.F_MODERATION "
			strSql = strsql & " FROM " & strTablePrefix & "FORUM "
		

It may fix it. Those two variables are just to be used on moved topics, but it may be possible that only the one that sets a value for moderation needs moving.

Test it and see if it works.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  20:15:00  Show Profile  Visit SiSL's Homepage
Changing Line 736 as from:
if mLev <> 4 and Moderation = "No" then

to
if mLev <> 4 and Moderation = "No" and Topic_Status < 2 then

worked... I'll try your method as well... So Not sure other backproblems those might cause...

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 January 2011 :  20:17:57  Show Profile  Send ruirib a Yahoo! Message
If my method worked, would be neater. Doesn't make much sense to have moderation set to "No" and topic status with a value of 2.
Let me know if it does.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 19 January 2011 :  20:40:55  Show Profile  Visit SiSL's Homepage
ruirib :( No, it does not work... For some reason it still updates forum table...

I mean even after moving those lines, I put response.Write moderation instead of those lines, it still says "No"

Because there is a Moderation = "no" also on top of file line 235, when I remove it also, it works, but I'm worried about consequences on other areas or edits...

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 19 January 2011 20:47:00
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07