Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Erroneous counting of threads for page selection
jense #1
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Subject: Erroneous counting of threads for page selection
AFAICS, $thread->Count does not respect access rights so that it can happen that one has more pages than needed (with empty pages at the end).  Since I display this number of threads in my headings, I need to fix it.  Is moving the page selection block below the main thread loop in UnbListThreads sufficient?  One could use $count at this point...
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I'm not sure what code you're referencing to, but it's a known problem that most counting and find methods don't consider access rights on forums, threads etc. That would be a highly complicated task because you'd need to evaludate all ACL rules for each item that's been fetched. So this is only done inside the display loop, for the items that are actually to be displayed.

Btw, this is an issue that has been fixed in the current UNB2 draft, where it is possible by design to evaluate all access rights on messages within the primary SQL query, which leads to correct counters in the first place.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #3
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Quote by Yves:
[...], but it's a known problem that most counting and find methods don't consider access rights on forums, threads etc.
Apparently, my suggestion won't work.  However, I'm somehow confused now: the same logic in the display of search results and thread/post lists leads to different result.  For instance, in thread lists the 'unreadable' threads are counted but not listed -- in the search result they are neither counted nor listed, AFAICS.
Btw, this is an issue that has been fixed in the current UNB2 draft, where it is possible by design to evaluate all access rights on messages within the primary SQL query, which leads to correct counters in the first place.
IIRC, at the expense of hierarchical access controls...
Alala, Alala, Gimme three wishes - CSS
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 146.5 ms (99.1 ms) · 56 database queries in 108.8 ms
Current time: 2013-05-18, 20:33:04 (UTC +02:00)