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
Comment #1
Anonymous (not verified) commentedThanks Joe ,
It looks as though
is redundant and the rest is fine .
Comment #2
joewang commentedI think my experience tells me that
$cntall = db_result($result);is fine withif ($cntall == $user->uid) return TRUE;and the while loop is redundant.Comment #3
Anonymous (not verified) commentedDoes anybody else want to comment on this ?
Thanks, Paul
Comment #4
Anonymous (not verified) commentedComment #5
joewang commentedThis 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?
Comment #6
joewang commentedComment #7
joewang commentedNevermind..