MyBB Community Forums

Full Version: [F] canviewthreads and private forums on forumlist [C-Michael83]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you have a forum set for "Can view forum?" to YES but "Can view threads within forum?" to NO you can still see the last post and thread title in the forum list. Below is the method to correct this. I would do it with a plugin but it's impossible and realistically I call this a bug. Of course double check my code but I believe it's just a simple check for the canviewthreads permission.


Inside inc/function_forumlist.php

Find this:
			// This forum has a password, and the user isn't authenticated with it - hide post information
			$hideinfo = false;
			if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
			{
				$hideinfo = true;
			}
Change to this:

			// This forum has a password, and the user isn't authenticated with it - hide post information
			$hideinfo = false;
			if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']) || $permissions['canviewthreads'] !=1)
			{
				$hideinfo = true;
			}

Thank you.
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
Revision #4308

This does not make sense. The fix is working - you cannot see the last post info in the forumlist anymore. But you're still able to see the thread list if you enter the forum.

In addition to that the forum is marked as locked although it isn't.
I didn't make any further changes beyond labrocca's suggested fix. Whatever is happening is a separate issue and you should write up a report for it separately