Merge pull request #7169 from nextcloud/fix-user-search
Fix search in user managent when no group is selected
This commit is contained in:
commit
82502b10db
|
@ -290,6 +290,8 @@ class Database extends Backend implements IUserBackend {
|
||||||
if ($search !== '') {
|
if ($search !== '') {
|
||||||
$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
|
$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
|
||||||
$searchLike = ' WHERE LOWER(`uid`) LIKE LOWER(?)';
|
$searchLike = ' WHERE LOWER(`uid`) LIKE LOWER(?)';
|
||||||
|
$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
|
||||||
|
$searchLike .= ' OR LOWER(`displayname`) LIKE LOWER(?)';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = \OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users`' . $searchLike . ' ORDER BY LOWER(`uid`) ASC', $limit, $offset);
|
$query = \OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users`' . $searchLike . ' ORDER BY LOWER(`uid`) ASC', $limit, $offset);
|
||||||
|
|
|
@ -308,7 +308,7 @@ class UsersController extends Controller {
|
||||||
$userObjects = [];
|
$userObjects = [];
|
||||||
$users = [];
|
$users = [];
|
||||||
if ($this->isAdmin) {
|
if ($this->isAdmin) {
|
||||||
if ($gid !== '' && $gid !== '_disabledUsers') {
|
if ($gid !== '' && $gid !== '_disabledUsers' && $gid !== '_everyone') {
|
||||||
$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
|
$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
|
||||||
} else {
|
} else {
|
||||||
$batch = $this->userManager->search($pattern, $limit, $offset);
|
$batch = $this->userManager->search($pattern, $limit, $offset);
|
||||||
|
|
Loading…
Reference in New Issue