From 7bc05c5e24ca632f3aa5dfd1fe1e6bd145f9d34c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 29 Apr 2006 01:18:57 +0000 Subject: - fixing some bugs, containing fixes for anonymous username displays, eaccelerator issue, permission trace and a few smaller bugs. git-svn-id: file:///svn/phpbb/trunk@5858 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_email.php | 12 +++++++----- phpBB/includes/acp/acp_permissions.php | 32 ++++++++++++++++++++++++-------- phpBB/includes/acp/acp_users.php | 4 ++++ 3 files changed, 35 insertions(+), 13 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 1d3149c958..4d254bb084 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -194,14 +194,16 @@ class acp_email } } - // Initial selection - $sql = 'SELECT group_id, group_type, group_name - FROM ' . GROUPS_TABLE . ' - ORDER BY group_type DESC, group_name ASC'; + // Exclude bots... + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); $select_list = ''; - $select_list .= group_select_options($group_id); + $select_list .= group_select_options($group_id, array($bot_group_id)); $s_priority_options = ''; $s_priority_options .= ''; diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 9ca25c8cf7..f42a03ba15 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -861,14 +861,14 @@ class acp_permissions { foreach ($forum_ary as $auth_option => $user_ary) { - $perms += $user_ary; + $perms = array_merge($perms, $user_ary); } } if (sizeof($perms)) { $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' - WHERE zebra_id IN (' . implode(', ', $perms) . ') + WHERE zebra_id IN (' . implode(', ', array_unique($perms)) . ') AND foe = 1'; $db->sql_query($sql); } @@ -882,21 +882,21 @@ class acp_permissions { global $db, $template, $user, $auth; - $sql = 'SELECT username + $sql = 'SELECT user_id, username, user_type FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); - $username = (string) $db->sql_fetchfield('username'); + $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$username) + if (!$user_row) { trigger_error('NO_USERS'); } $template->assign_vars(array( 'PERMISSION' => $user->lang['acl_' . $permission]['lang'], - 'PERMISSION_USERNAME' => $username) + 'PERMISSION_USERNAME' => $user_row['username']) ); $template->assign_block_vars('trace', array( @@ -990,9 +990,9 @@ class acp_permissions $total = ACL_NO; break; } - + $template->assign_block_vars('trace', array( - 'WHO' => $username, + 'WHO' => $user_row['username'], 'INFORMATION' => $information, 'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false, @@ -1002,6 +1002,22 @@ class acp_permissions 'S_TOTAL_YES' => ($total == ACL_YES) ? true : false, 'S_TOTAL_NO' => ($total == ACL_NO) ? true : false) ); + + // Take founder status into account, overwriting the default values + if ($user_row['user_type'] == USER_FOUNDER && strpos($permission, 'a_') === 0) + { + $template->assign_block_vars('trace', array( + 'WHO' => $user_row['username'], + 'INFORMATION' => $user->lang['TRACE_USER_FOUNDER'], + + 'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false, + 'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false, + 'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false, + 'S_TOTAL_UNSET' => false, + 'S_TOTAL_YES' => true, + 'S_TOTAL_NO' => false) + ); + } } } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 75ac50cdcb..7e0601d1dc 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1302,6 +1302,10 @@ class acp_users $filename = ''; $type = $width = $height = 0; } + else + { + $data = array(); + } } if (!sizeof($error)) -- cgit v1.2.1