MyBB Community Forums
[F] Forum subscription and permission - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.4 (https://community.mybb.com/forum-110.html)
+------ Thread: [F] Forum subscription and permission (/thread-45710.html)



[F] Forum subscription and permission - Michael S. - 02-24-2009

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.


RE: Forum subscription and permission - Ryan Gordon - 02-24-2009

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.


RE: Forum subscription and permission - dvb - 02-25-2009

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


RE: Forum subscription and permission - Ryan Gordon - 03-05-2009

Try this. Please test this in-depth!

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

if($done_users[$subscribedmember['uid']])
{
	continue;
}				
$done_users[$subscribedmember['uid']] = 1;

add after

$forumpermissions = forum_permissions($thread['fid'], $subscribedmember['uid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
	continue;
}



RE: Forum subscription and permission - labrocca - 03-05-2009

Good solution imho.


RE: Forum subscription and permission - Matt - 03-05-2009

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.


RE: Forum subscription and permission - dvb - 03-05-2009

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)
(03-05-2009, 07:10 PM)Ryan Gordon Wrote:
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
but
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.... ?


RE: Forum subscription and permission - Imad Jomaa - 03-05-2009

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.


RE: Forum subscription and permission - Ryan Gordon - 03-05-2009

1. no need

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

So == 0 is right. We only want to check if its disabled.


[F] Forum subscription and permission - Ryan Gordon - 03-05-2009

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