diff options
author | David M <davidmj@users.sourceforge.net> | 2008-02-02 18:24:07 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2008-02-02 18:24:07 +0000 |
commit | 72fbf492ca85996b787fbd3ef101da31d77278f6 (patch) | |
tree | 772369800f63692a55d117846f0cc382772f74f3 | |
parent | version bump from 2.0.22 to 2.0.23 (diff) | |
download | phpbb-72fbf492ca85996b787fbd3ef101da31d77278f6.tar.gz phpbb-72fbf492ca85996b787fbd3ef101da31d77278f6.tar.bz2 phpbb-72fbf492ca85996b787fbd3ef101da31d77278f6.zip |
Two fixes for the group permissions ACP...
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@8370 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/admin/admin_ug_auth.php | 47 | ||||
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 2 |
2 files changed, 43 insertions, 6 deletions
diff --git a/phpBB/admin/admin_ug_auth.php b/phpBB/admin/admin_ug_auth.php index 41805dcf1d..d41f27d18c 100644 --- a/phpBB/admin/admin_ug_auth.php +++ b/phpBB/admin/admin_ug_auth.php @@ -231,11 +231,46 @@ if ( isset($HTTP_POST_VARS['submit']) && ( ( $mode == 'user' && $user_id ) || ( else { - $change_mod_list = ( isset($HTTP_POST_VARS['moderator']) ) ? $HTTP_POST_VARS['moderator'] : false; + $change_mod_list = ( isset($HTTP_POST_VARS['moderator']) ) ? $HTTP_POST_VARS['moderator'] : array(); if ( empty($adv) ) { - $change_acl_list = ( isset($HTTP_POST_VARS['private']) ) ? $HTTP_POST_VARS['private'] : false; + $sql = "SELECT f.* + FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c + WHERE f.cat_id = c.cat_id + ORDER BY c.cat_order, f.forum_order ASC"; + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql); + } + + $forum_access = $forum_auth_level_fields = array(); + while( $row = $db->sql_fetchrow($result) ) + { + $forum_access[] = $row; + } + $db->sql_freeresult($result); + + for($i = 0; $i < count($forum_access); $i++) + { + $forum_id = $forum_access[$i]['forum_id']; + + for($j = 0; $j < count($forum_auth_fields); $j++) + { + $forum_auth_level_fields[$forum_id][$forum_auth_fields[$j]] = $forum_access[$i][$forum_auth_fields[$j]] == AUTH_ACL; + } + } + + while( list($forum_id, $value) = @each($_POST['private']) ) + { + while( list($auth_field, $exists) = @each($forum_auth_level_fields[$forum_id]) ) + { + if ($exists) + { + $change_acl_list[$forum_id][$auth_field] = $value; + } + } + } } else { @@ -289,11 +324,11 @@ if ( isset($HTTP_POST_VARS['submit']) && ( ( $mode == 'user' && $user_id ) || ( $forum_id = $forum_access[$i]['forum_id']; if ( - ( isset($auth_access[$forum_id]['auth_mod']) && $change_mod_list[$forum_id]['auth_mod'] != $auth_access[$forum_id]['auth_mod'] ) || - ( !isset($auth_access[$forum_id]['auth_mod']) && !empty($change_mod_list[$forum_id]['auth_mod']) ) + ( isset($auth_access[$forum_id]['auth_mod']) && $change_mod_list[$forum_id] != $auth_access[$forum_id]['auth_mod'] ) || + ( !isset($auth_access[$forum_id]['auth_mod']) && !empty($change_mod_list[$forum_id]) ) ) { - $update_mod_status[$forum_id] = $change_mod_list[$forum_id]['auth_mod']; + $update_mod_status[$forum_id] = $change_mod_list[$forum_id]; if ( !$update_mod_status[$forum_id] ) { @@ -996,4 +1031,4 @@ $template->pparse('body'); include('./page_footer_admin.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index cf95563a89..e236ac86e5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -80,6 +80,8 @@ p,ul,td {font-size:10pt;} <li>[Fix] Fixed spelling error(s) in lang_admin.php (Bug #7172, #6978)</li> <li>[Fix] Correctly display censored words in admin panel (Bug #12271)</li> <li>[Fix] Do not allow soft hyphen \xAD in usernames (reported by Bander00)</li> +<li>[Fix] Fixed the group permission system's use of array access</li> +<li>[Fix] Simple group permissions now work properly</li> </ul> <a name="2021"></a><h3 class="h3">l.ii. Changes since 2.0.21</h3> |