Chris: I took a look at the lines you asked about. Those were checked  
in just over a year ago as part of a permissions fix that caused  
people to get error messages when posting comments in polls. (See  
http://bugz.mostly-harmless.ca/show_bug.cgi?id=83 for the bug  
information.)

That code has been in use for a year now and it hasn't caused a  
problem for anybody that I've heard of.

CJ: I just went to wweek.com and saw something that wasn't the scoop  
site I saw on my last visit! Did I hit the wrong site or something?

Anyway, I was wondering if you could send me the results of an sql  
query on your scoop database - I'd like to make sure there isn't  
something fishy going on with the stories table.

SELECT sid,time,displaystatus,writestatus,edit_category FROM stories;

The fact that you don't get an error message, just no stories, when  
looking at a section index page (eg, domain.com/section/news) tells  
me there's nothing wrong with the section permissions. The stories  
are somehow marked as non-display in a way that triggers on the front  
and section and individual story pages, but not in the search. Since  
the front/section and single story pages use the same permissions  
checking mechanism, I'm not surprised that they all agree on whether  
or not a story should be displayed. The search page uses a different  
method, but they should still agree - and if they don't, one of them  
needs to be fixed... :-)

The three extra fields after sid (story ID) and time are used to  
determine where and how a story is displayed. I want to get problems  
with them out of the way before I start really digging into the code,  
since I haven't seen this problem in several sites running up-to-date  
code such as what you downloaded.

-janra


On 16-Mar-06, at 10:55 AM, Chris Schults wrote:

> Janra:
>
> I've been trying to help CJ, and from what I can see the perms are  
> setup
> correctly. And index_template still has |CONTENT|, and  
> story_template has
> |STORY|.
>
> I asked him to send me his Elements.pm file so I could take a look  
> at the
> displaystory function, which he did. I don't have the new version  
> of Scoop,
> but this snippet from the subroutine displaystory confused me:
>
> my $story_section = $story->{section} || $S->_get_story_section($sid);
> # check the section permissions
> if ($S->have_section_perm('deny_read_stories', $story_section) &&
> !$S->_does_poll_exist($sid)) {
> 	$page = qq| <b>%%norm_font%%Sorry, you don't have permission to read
> stories posted to this section.%%norm_font_end%%</b> |;
> } elsif ($S->have_section_perm('hide_read_stories', $section) &&
> !$S->_does_poll_exist($sid)) {
> 	$page = qq| <b>%%norm_font%%Sorry, I can't seem to find that
> story.%%norm_font_end%%</b> |;
> }
>
> Specifically this:
>
> && !$S->_does_poll_exist($sid)
>
> The above is not in my version, so this makes me think this might  
> be the
> culprit. I'm curious as to why this is even necessary.
>
> Chris