From abfb524b2901516048d9bd909fe6fd809a591f27 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 24 Mar 2015 21:35:44 +0100 Subject: [PATCH 1/3] When searching for displayname then search for displayname --- lib/private/group/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php index e7ba3ac375..d8e6919784 100644 --- a/lib/private/group/manager.php +++ b/lib/private/group/manager.php @@ -247,7 +247,7 @@ class Manager extends PublicEmitter implements IGroupManager { } do { - $filteredUsers = $this->userManager->search($search, $searchLimit, $searchOffset); + $filteredUsers = $this->userManager->searchDisplayName($search, $searchLimit, $searchOffset); foreach($filteredUsers as $filteredUser) { if($group->inGroup($filteredUser)) { $groupUsers[]= $filteredUser; From b1c513f000e468dc16c31890699b296d23548d92 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 24 Mar 2015 21:42:40 +0100 Subject: [PATCH 2/3] Fix unit tests Altough more are required to make sure this does not happen again --- tests/lib/group/manager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lib/group/manager.php b/tests/lib/group/manager.php index e3462caf80..76996a2b9b 100644 --- a/tests/lib/group/manager.php +++ b/tests/lib/group/manager.php @@ -448,7 +448,7 @@ class Manager extends \Test\TestCase { $userBackend = $this->getMock('\OC_User_Backend'); $userManager->expects($this->any()) - ->method('search') + ->method('searchDisplayName') ->with('user3') ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { switch($offset) { @@ -513,7 +513,7 @@ class Manager extends \Test\TestCase { $userBackend = $this->getMock('\OC_User_Backend'); $userManager->expects($this->any()) - ->method('search') + ->method('searchDisplayName') ->with('user3') ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { switch($offset) { @@ -580,7 +580,7 @@ class Manager extends \Test\TestCase { $userBackend = $this->getMock('\OC_User_Backend'); $userManager->expects($this->any()) - ->method('search') + ->method('searchDisplayName') ->with('user3') ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { switch($offset) { From 4163a5efadd5984010d455c7cbd848bd17d5450d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 24 Mar 2015 21:43:26 +0100 Subject: [PATCH 3/3] Call the proper function * Fix for #6967 --- core/ajax/share.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ajax/share.php b/core/ajax/share.php index d8aec9c654..d5f50c23ae 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -248,7 +248,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo while ($count < 15 && count($users) == $limit) { $limit = 15 - $count; if ($shareWithinGroupOnly) { - $users = OC_Group::DisplayNamesInGroups($usergroups, (string)$_GET['search'], $limit, $offset); + $users = OC_Group::displayNamesInGroups($usergroups, (string)$_GET['search'], $limit, $offset); } else { $users = OC_User::getDisplayNames((string)$_GET['search'], $limit, $offset); }