diff options
author | Marcin Łojewski <marcin.lojewski@mlojewski.me> | 2019-10-08 19:35:31 +0300 |
---|---|---|
committer | Marcin Łojewski <marcin.lojewski@mlojewski.me> | 2019-10-08 19:38:51 +0300 |
commit | a19144a25480b0ecd55e25e42a782a65ba387948 (patch) | |
tree | 589a8cc64f76ca7fe1cbbad3b6332c94f6c8efe1 | |
parent | c09499648b83c79a9517970bd33a6c24cae0eddc (diff) |
issue#91 Find group by gid or groupname, find user by uid or display name or email
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | lib/Query/QueryProvider.php | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b8c4686..8c17aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Users can confirm passwords - Support Nextcloud password_policy +- Extend user/group search ### Fixed - Getting user display names backend diff --git a/lib/Query/QueryProvider.php b/lib/Query/QueryProvider.php index 15092cb..eca7571 100644 --- a/lib/Query/QueryProvider.php +++ b/lib/Query/QueryProvider.php @@ -140,6 +140,7 @@ class QueryProvider implements \ArrayAccess "SELECT $groupColumns " . "FROM $group g " . "WHERE g.$gGID LIKE :$searchParam " . + (empty($gName) ? "" : "OR g.$gName LIKE :$searchParam ") . "ORDER BY g.$gGID", Query::FIND_USER => @@ -163,6 +164,8 @@ class QueryProvider implements \ArrayAccess "SELECT $userColumns " . "FROM $user u " . "WHERE u.$uUID LIKE :$searchParam " . + (empty($uName) ? "" : "OR u.$uName LIKE :$searchParam ") . + (empty($uEmail) ? "" : "OR u.$uEmail LIKE :$searchParam ") . "ORDER BY u.$uUID", Query::UPDATE_DISPLAY_NAME => |