Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Forum subscription and permission
If a user subscribes to a forum and you revoke the permissions on this forum the user still gets emails about new threads with the abstracts of the posts.
[Image: donation_drive_sig.png]
I think the reason is because it's a bit complex to run a query to go and remove all subscriptions just because you may or may not have temporarily/accidentally changed the permissions on a forum.
But this is what should be done, no?

The reported case isn't so common, but here is a more common one:

If a normal user subscribed to a thread on a public view and then a moderator decide to move the thread to a private forum, and continue the discussion privately within the forum team, according to this bug, the subscribed user will still be able to read the start of every reply...

This is of course an unwanted behavior
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Try this. Please test this in-depth!

In inc/datahandler/post.php find BOTH instances:

$done_users[$subscribedmember['uid']] = 1;

add after

$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
Good solution imho.
I'll give it a test and feedback.

I've tested it a few times and it seems to work but I'll test it more to make sure.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Its looks fine and not interfering with anything...

I've tried to look at the code, understand, and compare it to other places, 2 little little things that probably doesn't matter:

1. this:
File inc\datahandlers\post.php, Line 854 Wrote:
			$done_users = array();
exists only in the function insert_post(), should be fixed?

2. here you wrote (and as well as in usercp2.php where we normally add a subscription)
(2009-03-05, 07:10 PM)Ryan Gordon Wrote:
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
File showthread.php, Line 99 Wrote:
if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1)
Does it matter? ( == 0 / != 1 )
I know that normally a permission field can be 0 or 1 so the mentioned lines should be the same but.... ?
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Quote:Does it matter? ( == 0 / != 1 )

If it equals zero, it has to be zero. If it doesn't equal one, it can be 0, 2, 3, 4, etc. In this case however, it doesn't look like it matters, I could be wrong though.
1. no need

2. Permissions are either "0" (no) or "1" (yes)

So == 0 is right. We only want to check if its disabled.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group

Forum Jump:

Users browsing this thread: 1 Guest(s)