diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php
index f7c1a42c8c..f83a203abc 100644
--- a/phpBB/admin/admin_permissions.php
+++ b/phpBB/admin/admin_permissions.php
@@ -74,14 +74,17 @@ switch ( $mode )
case 'forums':
$l_title = $lang['Permissions'];
$l_title_explain = $lang['Permissions_explain'];
+ $l_can = '_can';
break;
case 'moderators':
$l_title = $lang['Moderators'];
$l_title_explain = $lang['Moderators_explain'];
+ $l_can = '_can';
break;
case 'administrators':
$l_title = $lang['Administrators'];
$l_title_explain = $lang['Administrators_explain'];
+ $l_can = '_can_admin';
break;
}
@@ -106,13 +109,12 @@ if ( !empty($forum_id) || $mode == 'administrators' )
$forum_info = $db->sql_fetchrow($result);
$l_title .= ' : ' . $forum_info['forum_name'] . '';
- $s_hidden_fields = '';
}
//
// Generate header
//
- page_header($lang['Forums']);
+ page_header($l_title);
?>
@@ -126,422 +128,252 @@ if ( !empty($forum_id) || $mode == 'administrators' )
{
case 'forums':
-?>
+ $type_sql = 'forum';
+ $forum_sql = "AND a.forum_id = $forum_id";
-
-
-
-
-
+
+
+ |
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+ |
+
+ |
+
+
+
sql_query($sql);
+
+ $auth_options = array();
+ while ( $row = $db->sql_fetchrow($result) )
+ {
+ $auth_options[] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ $where_sql = '';
+ foreach ( $HTTP_POST_VARS['entries'] as $id )
+ {
+ $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . intval($id);
+ }
+
+ switch ( $HTTP_POST_VARS['type'] )
+ {
+ case 'group':
+ $l_type = 'Group';
+
+ $sql = "SELECT g.group_id, g.group_name, o.auth_option, a.auth_allow_deny
+ FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
+ WHERE o.auth_type LIKE '$type_sql'
+ AND a.auth_option_id = o.auth_option_id
+ $forum_sql
+ AND g.group_id = a.group_id
+ AND g.group_id IN ($where_sql)
+ ORDER BY g.group_name ASC";
+ break;
+
+ case 'user':
+ $l_type = 'User';
+
+ $sql = "SELECT u.user_id, u.username, o.auth_option, a.auth_allow_deny
+ FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
+ WHERE o.auth_type LIKE '$type_sql'
+ AND a.auth_option_id = o.auth_option_id
+ $forum_sql
+ AND u.user_id = a.user_id
+ AND u.user_id IN ($where_sql)
+ ORDER BY u.username, u.user_regdate ASC";
+ break;
+ }
+
+ $result = $db->sql_query($sql);
+
+ $ug = '';;
+ $auth = array();
+ while ( $row = $db->sql_fetchrow($result) )
+ {
+ $ug_name = ( ( $row['group_name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : ( ( $HTTP_POST_VARS['type'] == 'user' ) ? $row['username'] : $row['group_name'] ) );
+ $ug .= ( !strstr($ug, $ug_name) ) ? $ug_name . "\n" : '';
+
+ $auth[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny'];
+ }
+ $db->sql_freeresult($result);
+
+?>
+
+
+
+sql_freeresult($result);
- page_header($lang['Forums']);
+ page_header($l_title);
?>