TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,989
  • Total Topics: 21,322
  • Online today: 897
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 543
  • Total: 543

Front Page Block permissions

Started by psa, April 07, 2010, 06:20:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

psa

Link to my site: http://writebytherivers.org/ (not going to do much good since the content is all private)
SMF version: 2.0 RC3
TP version: v1.0 beta5
Theme name and version: ModernDark32 latest for 2.0 RC3
Browser Name and Version: Firefox3.6, Safari4, Chrome5, etc.
Mods installed: TP only
Related Error messages: None that I can see

I'm having trouble getting front page blocks to show up for members but not guests, and vice versa.  If one of them is defined, both groups can see the block on the front page.  This is confirmed with HTML, PHP, and article-only blocks, but only in the front page panel.

I was digging into the code to understand how the system works, and I noticed this bit in TPortal.php within the front page block gathering code:

        // set the membergroup access
        $mygroups = $user_info['groups'];
        $mygroups[] = '-1'; $mygroups[] = 0;
        $access = '(FIND_IN_SET(' . implode(', access) OR FIND_IN_SET(', $mygroups) . ', access))';

It appears to be explicitly adding the guest (-1) and uncategorized member (0) groups to the user's own groups before writing out the SQL code to query for blocks.  Commenting out that line yields the behavior I expected, with guest permissions not granting member viewing, and vice versa.

I'm not sure why that line is in there--am I breaking something here?

Thanks.
Paul

bloc

Well, no, not exactly..but all members have also automatically guest access as well as uncategorised member access. So according to SMF a regular member also sees what guests sees. Removing them makes that go away.

It might be better to not have this there, but I will examine it and see if its affecting something else.

psa

An odd security policy when they have a granular access system (independent security levels rather than a single adjustable level).  Is there a better way to show content to guests that does not show for members, then?

And, despite this, I shouldn't have member content showing up for guests (the second half of that line).

Thanks for your help.  TinyPortal has completely changed the way I approach community websites, and I'm so glad to have a version for SMF2 to dig into.

This website is proudly hosted on Crocweb Cloud Website Hosting.