Commit bf17ac92 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #15169 from rullzer/fix_displayNamesInGroup

Groupmanagers displayNamesInGroup should actually search in displaynames
parents 308a43a1 4163a5ef
...@@ -262,7 +262,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo ...@@ -262,7 +262,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
while ($count < 15 && count($users) == $limit) { while ($count < 15 && count($users) == $limit) {
$limit = 15 - $count; $limit = 15 - $count;
if ($shareWithinGroupOnly) { if ($shareWithinGroupOnly) {
$users = OC_Group::DisplayNamesInGroups($usergroups, (string)$_GET['search'], $limit, $offset); $users = OC_Group::displayNamesInGroups($usergroups, (string)$_GET['search'], $limit, $offset);
} else { } else {
$users = OC_User::getDisplayNames((string)$_GET['search'], $limit, $offset); $users = OC_User::getDisplayNames((string)$_GET['search'], $limit, $offset);
} }
......
...@@ -267,7 +267,7 @@ class Manager extends PublicEmitter implements IGroupManager { ...@@ -267,7 +267,7 @@ class Manager extends PublicEmitter implements IGroupManager {
} }
do { do {
$filteredUsers = $this->userManager->search($search, $searchLimit, $searchOffset); $filteredUsers = $this->userManager->searchDisplayName($search, $searchLimit, $searchOffset);
foreach($filteredUsers as $filteredUser) { foreach($filteredUsers as $filteredUser) {
if($group->inGroup($filteredUser)) { if($group->inGroup($filteredUser)) {
$groupUsers[]= $filteredUser; $groupUsers[]= $filteredUser;
......
...@@ -448,7 +448,7 @@ class Manager extends \Test\TestCase { ...@@ -448,7 +448,7 @@ class Manager extends \Test\TestCase {
$userBackend = $this->getMock('\OC_User_Backend'); $userBackend = $this->getMock('\OC_User_Backend');
$userManager->expects($this->any()) $userManager->expects($this->any())
->method('search') ->method('searchDisplayName')
->with('user3') ->with('user3')
->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) {
switch($offset) { switch($offset) {
...@@ -513,7 +513,7 @@ class Manager extends \Test\TestCase { ...@@ -513,7 +513,7 @@ class Manager extends \Test\TestCase {
$userBackend = $this->getMock('\OC_User_Backend'); $userBackend = $this->getMock('\OC_User_Backend');
$userManager->expects($this->any()) $userManager->expects($this->any())
->method('search') ->method('searchDisplayName')
->with('user3') ->with('user3')
->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) {
switch($offset) { switch($offset) {
...@@ -580,7 +580,7 @@ class Manager extends \Test\TestCase { ...@@ -580,7 +580,7 @@ class Manager extends \Test\TestCase {
$userBackend = $this->getMock('\OC_User_Backend'); $userBackend = $this->getMock('\OC_User_Backend');
$userManager->expects($this->any()) $userManager->expects($this->any())
->method('search') ->method('searchDisplayName')
->with('user3') ->with('user3')
->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) { ->will($this->returnCallback(function($search, $limit, $offset) use ($userBackend) {
switch($offset) { switch($offset) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment