From d9576fd70ba9f60c99a2ece5e520b309a86f7362 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 23 Apr 2006 13:08:48 +0000 Subject: - allow user A to have user B as a friend if A is a foe of B - don't allow users to have the Anonymous user on their foe/friend list [Bug #1205] - properly hide users on the online/offline friend list in ucp [Bug #1206] git-svn-id: file:///svn/phpbb/trunk@5836 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_zebra.php | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'phpBB/includes/ucp/ucp_zebra.php') diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index cfe1fb9071..e061aa590c 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -87,12 +87,15 @@ class ucp_zebra $user_id_ary = array(); do { - $user_id_ary[] = $row['user_id']; + if ($row['user_id'] != ANONYMOUS) + { + $user_id_ary[] = $row['user_id']; + } } while ($row = $db->sql_fetchrow($result)); // Remove users from foe list if they are admins or moderators - if ($mode == 'foes') + if (($mode == 'foes') && sizeof($user_id_ary)) { $perms = array(); foreach ($auth->acl_get_list($user_id_ary, array('a_', 'm_')) as $forum_id => $forum_ary) @@ -108,29 +111,6 @@ class ucp_zebra unset($perms); } - // Do not let add users to friends if the user is within the foes list of the to-be-added users - if ($mode == 'friends' && sizeof($user_id_ary)) - { - $sql = 'SELECT user_id - FROM ' . ZEBRA_TABLE . ' - WHERE user_id IN (' . implode(', ', $user_id_ary) . ') - AND zebra_id = ' . $user->data['user_id'] . ' - AND foe = 1'; - $result = $db->sql_query($sql); - - $remove_user_ids = array(); - while ($row = $db->sql_fetchrow($result)) - { - $remove_user_ids[] = $row['user_id']; - } - - if (sizeof($remove_user_ids)) - { - $user_id_ary = array_diff($user_id_ary, $remove_user_ids); - } - unset($remove_user_ids); - } - if (sizeof($user_id_ary)) { $sql_mode = ($mode == 'friends') ? 'friend' : 'foe'; -- cgit v1.2.1