Hi guys

I'vo got a problem with OG-forum visibility.
I made the forums public but the non member user of a group or not registered user cannot see the threads inside the og forums.
the forums are visible but only the threads?

what's wrong here?

Comments

pro.methean’s picture

I am having this issue in 6.x-2.2.

Now in my environment Forum Topic is set with View Anonymous and View Authenticated as off, figuring the OG Forums would take care of escalated the privileges. It does take care of it properly for group members but not for outsiders.

Should this be happening in og_forum_db_rewrite_sql? I have patched out some code that was giving me trouble, but don't see how that could be the cause:

http://drupal.org/node/651672#comment-3341090

I've been pouring over the og_forums.module but have not been able to determine, Where and how is this privileges escalation (for members) is happening, or should be happening (for non-members).

Any pointers?

- Pro

drupalninja99’s picture

I think the $user->og_groups isn't populated by the time the og_forum module checks it. $user->og_groups is populated in og_init() but when I do a print_r() in the og_forum_access_forum_page() it isn't populated. that is being called by a menu alter hook.

drupalninja99’s picture

Version: 6.x-1.4 » 6.x-2.2
Status: Active » Needs review

OK I just made a patch to 2.2, altho I'm having trouble exporting it so I will just paste in the code

function og_forum_access_forum_page($tid = 0) {
  if (!user_access('access content')) {
    return FALSE;
  }
  global $user;

  /**
   * It's possible that this function get's called before og_init() so this
   * will make sure the groups get initialized
   */
  if (!isset($user->og_groups))
    og_user('load', array(), $user);

We just need the og_forum_access_forum_page() page to load the groups into the user object if they aren't already available.

pro.methean’s picture

This may be related to my #1168010: Forum topic sometimes created as private even though created in public forum on the og_forum_resurrection sandbox.

vegantriathlete’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Issue summary: View changes
Status: Needs review » Closed (won't fix)