Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Forum Management - Setting permisions (when all perms are 0)
#1
When all permissions are unchecked: (in ADMINDIR/index.php?module=forum/management&fid=FID#tab_permissions)
foreach($mybb->input['permissions'] as $gid => $permission)

will not work:
Warning [2] Invalid argument supplied for foreach() - Line: 1662 - File: admin/modules/forum/management.php PHP 4.3.11 (Linux)

File: /admin/modules/forum/management.php Line: 1662 Function: unknown

it might be only me but I can't seem to fix it :/
All my plugins are available for free at MyBB Extend and on my GitHub. MyBB-Plugins.com has been closed and none of my plugins are officially maintained or supported.
#2
In /admin/modules/forum/management.php find:

foreach($mybb->input['permissions'] as $gid => $permission)
{
	foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name)
	{
		if($permission[$name])
		{
			$permissions[$name][$gid] = 1;
		}
		else
		{
			$permissions[$name][$gid] = 0;
		}
	}
}

replace with

if(empty($mybb->input['permissions']))
{
	$mybb->input['permissions'] = array();
}
foreach($mybb->input['permissions'] as $gid => $permission)
{
	foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name)
	{
		if($permission[$name])
		{
			$permissions[$name][$gid] = 1;
		}
		else
		{
			$permissions[$name][$gid] = 0;
		}
	}
}
#3
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)