From 33a9c6df9f8082bef64c15932dae431177512446 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 29 Jul 2002 17:50:54 +0000 Subject: [PATCH] Need to look-see @ group output git-svn-id: file:///svn/phpbb/trunk@2788 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_permissions.php | 307 ++++++++++++++++++++++++------ 1 file changed, 248 insertions(+), 59 deletions(-) diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 565a77e037..a78f5aff98 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -238,13 +238,13 @@ if ( !empty($forum_id) || $mode == 'administrators' ) - - - + + + sql_query($sql); - $auth_options = array(); - while ( $row = $db->sql_fetchrow($result) ) + $where_user_sql = ''; + if ( !empty($HTTP_POST_VARS['users']) ) { - $auth_options[] = $row; + if ( is_array($HTTP_POST_VARS['users']) ) + { + foreach ($HTTP_POST_VARS['users'] as $user_id) + { + $where_user_sql .= ( ( $where_user_sql != '' ) ? ', ' : '' ) . intval($user_id); + } + } + else + { + $where_user_sql = intval($HTTP_POST_VARS['users']); + } + + $where_user_sql = " AND u.user_id IN ($where_user_sql)"; } - $sql = "SELECT u.user_id, u.username, ao.auth_option - FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'admin' - AND au.auth_option_id = ao.auth_option_id - AND u.user_id = au.user_id - ORDER BY u.username, u.user_regdate ASC"; - $result = $db->sql_query($sql); + $discrete_user_sql = ( empty($HTTP_POST_VARS['discrete']) || empty($HTTP_POST_VARS['users']) || is_array($HTTP_POST_VARS['users']) ) ? ' DISTINCT ' : 'ao.auth_option, '; - $auth_users = array(); - while ( $row = $db->sql_fetchrow($result) ) + $where_groups_sql = ''; + if ( !empty($HTTP_POST_VARS['groups']) ) { - $auth_users[$row['auth_option']] .= ''; - } + if ( is_array($HTTP_POST_VARS['groups']) ) + { + foreach ($HTTP_POST_VARS['groups'] as $group_id) + { + $where_groups_sql .= ( ( $where_groups_sql != '' ) ? ', ' : '' ) . intval($group_idf); + } + } + else + { + $where_groups_sql = intval($HTTP_POST_VARS['groups']); + } - $sql = "SELECT g.group_id, g.group_name, ao.auth_option - FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'admin' - AND ag.auth_option_id = ao.auth_option_id - AND g.group_id = ag.group_id - ORDER BY g.group_name ASC"; - $result = $db->sql_query($sql); - - $auth_groups = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_groups[$row['auth_option']] .= ''; + $where_groups_sql = " AND g.group_id IN ($where_groups_sql)"; } ?> - +

+ +">
+sql_query($sql); + + $users = ''; + while ( $row = $db->sql_fetchrow($result) ) + { + $users .= ''; + } + +?> - - + + + + + + + sql_query($sql); + + $auth_options = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $auth_options[] = $row; + } + + $sql = "SELECT u.user_id, u.username, ao.auth_option, au.auth_allow_deny + FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao + WHERE ao.auth_type LIKE 'admin' + AND au.auth_option_id = ao.auth_option_id + AND u.user_id = au.user_id + $where_user_sql + ORDER BY u.username, u.user_regdate ASC"; + $result = $db->sql_query($sql); + + $users = array(); + $auth_user = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $users[] = ''; + + $auth_user[$row['auth_option']] = ( isset($auth_user[$row['auth_option']]) ) ? min($auth_user[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; + } + + $users = implode('', array_unique($users)); ?> - - + + + + + + + + + + + + + - - +
SettingUsers
 
       
/> />
  
 
+ +
"> + + + + + + + +
    &mode=searchuser&form=1&field=newuser', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" />
-
- - - - - + + + + + + + + + + +

+ +">
SettingGroups
sql_query($sql); + + $groups = ''; + while ( $row = $db->sql_fetchrow($result) ) + { + $groups .= ''; + } ?> - - + + + + + + + + +sql_query($sql); + + $auth_options = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $auth_options[] = $row; + } + + $sql = "SELECT g.group_id, g.group_name, ao.auth_option, ag.auth_allow_deny + FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao + WHERE ao.auth_type LIKE 'admin' + AND ag.auth_option_id = ao.auth_option_id + AND g.group_id = ag.group_id + $where_groups_sql + ORDER BY g.group_name ASC"; + $result = $db->sql_query($sql); + + $groups = array(); + $auth_group = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $groups[] = ''; + + $auth_group[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; + } + + $groups = implode('', array_unique($groups)); + +?> + + + + + + + + + + + + + + - - +
 
 
      
/> />
  
 
+ +
"> + + + + + + + +