Current time: 03-21-2010, 12:41 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Forum Management - Setting permisions (when all perms are 0)
11-26-2008, 03:38 PM (This post was last modified: 11-26-2008 03:39 PM by Pirata Nervo.)
Post: #1
[F] Forum Management - Setting permisions (when all perms are 0)
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 :/

[Image: mybb-plugins.png]
Console World - Console World brings you the news you must know about your console, every day!
Visit this user's website Find all posts by this user
11-27-2008, 02:44 AM (This post was last modified: 11-27-2008 02:45 AM by Ryan Gordon.)
Post: #2
RE: Forum Management - Setting permisions (when all perms are 0)
In /admin/modules/forum/management.php find:

PHP Code:
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

PHP Code:
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;
        }
    }


[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
11-27-2008, 07:10 AM
Post: #3
[F] Forum Management - Setting permisions (when all perms are 0)
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

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user


Forum Jump: