Index: og_forum.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og_forum/Attic/og_forum.module,v retrieving revision 1.11.2.11.2.18.2.17.2.14 diff -u -p -r1.11.2.11.2.18.2.17.2.14 og_forum.module --- og_forum.module 28 Oct 2009 10:52:43 -0000 1.11.2.11.2.18.2.17.2.14 +++ og_forum.module 29 Oct 2009 15:29:28 -0000 @@ -397,9 +397,9 @@ function og_forum_db_rewrite_sql($query, global $user; if ($primary_field == 'tid') { - if (arg(0) == 'forum') { + if (arg(0) == 'forum') { if (user_access('administer forums') || (!module_exists('og_access') || variable_get('forum_all_public', 0))) { - return; + return; // On forum* paths, filter terms by og_forum_is_public() and the user's // group memberships via {og_term} relationships. } else { @@ -413,7 +413,14 @@ function og_forum_db_rewrite_sql($query, return $return; } } - if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum' && empty($_GET['gids'])) { + + if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum') { + if (isset($_GET['gids']) && is_array($_GET['gids']) && isset($_GET['gids'][0]) && is_numeric($_GET['gids'][0])) { + if (in_array($_GET['gids'][0], array_keys($user->og_groups))) { + return; + } + } + $return['join'] = "LEFT JOIN {og_term} ogt ON t.tid = ogt.tid"; $return['where'] = "ogt.nid IS NULL"; if ($og_forum_container = variable_get('forum_default_container', FALSE)) {