From 9d7557282e66335748d9c67ccc1db49f4aaf2f6b Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Thu, 11 May 2017 16:59:22 +0100 Subject: [PATCH] Add search attribute to user interface --- lib/private/Group/Manager.php | 2 +- lib/private/User/Account.php | 1 + lib/private/User/RemoteUser.php | 13 +++++++++++++ lib/private/User/User.php | 16 ++++++++++++++++ lib/public/IUser.php | 17 +++++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 1eed21471885..48557d2a72f8 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -397,7 +397,7 @@ public function findUsersInGroup($gid, $search = '', $limit = -1, $offset = 0) { foreach($groupUsers as $groupUser) { $matchingUsers[$groupUser->getUID()] = $groupUser; } - die(var_dump($matchingUsers)); + return $matchingUsers; } diff --git a/lib/private/User/Account.php b/lib/private/User/Account.php index 92fde74c619d..9d201dffa973 100644 --- a/lib/private/User/Account.php +++ b/lib/private/User/Account.php @@ -46,6 +46,7 @@ * @method string getHome() * @method void setHome(string $home) * @method void setSearchAttributes(string $searchAttributes) + * @method string getSearchAttributes() * * @package OC\User */ diff --git a/lib/private/User/RemoteUser.php b/lib/private/User/RemoteUser.php index 782f321cf60d..8c0d0012e261 100644 --- a/lib/private/User/RemoteUser.php +++ b/lib/private/User/RemoteUser.php @@ -197,4 +197,17 @@ public function getQuota() { public function setQuota($quota) { } + /** + * @inheritdoc + */ + public function getSearchAttributes() { + return ''; + } + + /** + * @inheritdoc + */ + public function setSearchAttributes($searchString) { + } + } diff --git a/lib/private/User/User.php b/lib/private/User/User.php index b25b3ea02ff7..cc2600f6ee1c 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -433,4 +433,20 @@ public function triggerChange($feature, $value = null) { $this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value]); } } + + /** + * @return string + * @since 10.0.1 + */ + public function getSearchAttributes() { + return $this->account->getSearchAttributes(); + } + + /** + * @return string + * @since 10.0.1 + */ + public function setSearchAttributes($searchString) { + $this->account->setSearchAttributes($searchString); + } } diff --git a/lib/public/IUser.php b/lib/public/IUser.php index 5df691d73384..f8fc418a541f 100644 --- a/lib/public/IUser.php +++ b/lib/public/IUser.php @@ -200,4 +200,21 @@ public function getQuota(); */ public function setQuota($quota); + /** + * set the users' search attributes + * + * @param string $searchString + * @return void + * @since 10.0.1 + */ + public function setSearchAttributes($searchString); + + /** + * get the users' search attributes + * + * @return string + * @since 10.0.1 + */ + public function getSearchAttributes(); + }