Half of the og_forum_is_admin function is not run:

function og_forum_is_admin($group) {
  global $user;
  $result = db_query(og_list_users_sql(0), $group->nid);
  $cntall = db_result($result);
  $cntpending = 0;
  while ($row = db_fetch_object($result)) {
    if ($user->uid == 1 && user_access('administer forums')) return TRUE;
    if ($row->uid == $user->uid) {
      if ($row->is_admin > 0) return TRUE;
    }
  }
  return FALSE;
} // function og_forum_is_admin()

The whole while loop doesn't run, so a group admin cannot manage his/her forums. I have added the line:

  if ($cntall == $user->uid) return TRUE;

before the while loop, which works perfectly. I don't see the reason for the while loop, nor the $cntpending variable.

Comments

Anonymous’s picture

Thanks Joe ,

It looks as though

$cntall = db_result($result);
 $cntpending = 0;

is redundant and the rest is fine .

joewang’s picture

I think my experience tells me that
$cntall = db_result($result); is fine with if ($cntall == $user->uid) return TRUE; and the while loop is redundant.

Anonymous’s picture

Title: og_forum_is_admin function routine obsolete » [More info] og_forum_is_admin function routine obsolete

Does anybody else want to comment on this ?

Thanks, Paul

Anonymous’s picture

Status: Needs review » Closed (fixed)
joewang’s picture

Status: Active » Closed (fixed)

This is still not working. Just tried a fresh install of Drupal/OG/OG_Forum

Group admins cannot see the link "Manage group forums" with your fix. Have you tried this yourself?

joewang’s picture

Status: Closed (fixed) » Active
joewang’s picture

Nevermind..