From 835f36cb09c9eb13e7475ba49c89802e50b8eec9 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Tue, 8 Oct 2013 16:43:23 +0200
Subject: [PATCH] find users which are in the same group

---
 core/ajax/share.php   | 2 +-
 lib/private/group.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/ajax/share.php b/core/ajax/share.php
index 1166ea3198a..dbad8f2e971 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -293,7 +293,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 				while ($count < 15 && count($users) == $limit) {
 					$limit = 15 - $count;
 					if ($sharePolicy == 'groups_only') {
-						$users = OC_Group::DisplayNamesInGroups($groups, $_GET['search'], $limit, $offset);
+						$users = OC_Group::DisplayNamesInGroups($usergroups, $_GET['search'], $limit, $offset);
 					} else {
 						$users = OC_User::getDisplayNames($_GET['search'], $limit, $offset);
 					}
diff --git a/lib/private/group.php b/lib/private/group.php
index ba93dc129a1..9144ef683b6 100644
--- a/lib/private/group.php
+++ b/lib/private/group.php
@@ -265,7 +265,7 @@ class OC_Group {
 	public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
 		$group = self::getManager()->get($gid);
 		if ($group) {
-			$users = $group->searchDisplayName($search . $limit, $offset);
+			$users = $group->searchDisplayName($search, $limit, $offset);
 			$displayNames = array();
 			foreach ($users as $user) {
 				$displayNames[] = $user->getDisplayName();
-- 
GitLab