Hello,

I used og_forum for managing forums of some groups.
In one group forum, the page of forum/$tid should be opened for both logged and anonymous users.
but, this page cannot be opened for anonymous users' due to the following if from og_forum.module line 110:

if ($gid) {
if (!array_key_exists($gid, $user->og_groups) && ($user->uid != 1) /*&& !user_access("create forum topics") && !user_access("access content")*/) {
return drupal_access_denied();
}
}

I think the comment I add here can solve that problem, because this if didn't take "user_access" permissions into account..
Am I right?

one more Question:
I don't want to touch og_forum.module myself, How can I override this function (menu callback) "og_forum_page" in my module?

many thanks!

Miriam.

Comments

Anonymous’s picture

Assigned: mirian »

I could not reproduce this problem , can anyone see a problem in this direction ?

I am not sure if you can (or need) to override a call back function defined in one module with
another defined in your module it will almost certainly lead to a "function declared multiple times"
problem

Paul

rconstantine’s picture

Status: Active » Closed (works as designed)

@Paul

Doesn't look like a problem to me, but a feature request/misunderstanding. It sounds like he wants group forum posts to be visible by anonymous users which goes against OG principles, at least in regards to the !user_access("access content") portion. It may be that we could take out the check against whether a user can create forum topics. I don't recall what part of the code this is in. If it's in the forum creation part, then it needs to stay in. If it is just for displaying posts, then perhaps we can remove it. However, users should be using the public/private features and not try to circumvent them as this user is doing. So technically, this is a 'by design' and is not a bug.

Naturalist’s picture

I would disagree. Public is public. That would include anonymous. I can view Drupal's forum anonymously no problem. The reason OG and OF is great is that you can create multiple forums and restrict access to a select group of people. An addition to what Drupal forums already offers. If I am getting this right, by going with OG you loose something to gain something. I think for the users it would get way too complicated to have both Drupal forums and OG forums on the same site. Are you saying that is the only way to have a truly public forum. To use Drupal Forum (core) for a true public forum. I am only trying to understand and maybe I have something set wrong but I do want anonymous users to view public posts. Thanks