summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Encryption/Util.php8
-rw-r--r--lib/private/Share/Share.php6
-rw-r--r--lib/private/legacy/user.php21
3 files changed, 12 insertions, 23 deletions
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php
index fc0adbbd47b..ddd19ac6345 100644
--- a/lib/private/Encryption/Util.php
+++ b/lib/private/Encryption/Util.php
@@ -35,6 +35,7 @@ use OC\Files\Filesystem;
use OC\Files\View;
use OCP\Encryption\IEncryptionModule;
use OCP\IConfig;
+use OCP\IUser;
class Util {
@@ -271,9 +272,12 @@ class Util {
}
public function getUserWithAccessToMountPoint($users, $groups) {
- $result = array();
+ $result = [];
if (in_array('all', $users)) {
- $result = \OCP\User::getUsers();
+ $users = $this->userManager->search('', null, null);
+ $result = array_map(function(IUser $user) {
+ return $user->getUID();
+ }, $users);
} else {
$result = array_merge($result, $users);
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 90a05ac51a8..9c82fcc268b 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -1238,7 +1238,8 @@ class Share extends Constants {
$row['share_with_displayname'] = $row['share_with'];
if ( isset($row['share_with']) && $row['share_with'] != '' &&
$row['share_type'] === self::SHARE_TYPE_USER) {
- $row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']);
+ $shareWithUser = \OC::$server->getUserManager()->get($row['share_with']);
+ $row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName();
} else if(isset($row['share_with']) && $row['share_with'] != '' &&
$row['share_type'] === self::SHARE_TYPE_REMOTE) {
$addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD']);
@@ -1251,7 +1252,8 @@ class Share extends Constants {
}
}
if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
- $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);
+ $ownerUser = \OC::$server->getUserManager()->get($row['uid_owner']);
+ $row['displayname_owner'] = $ownerUser === null ? $row['uid_owner'] : $ownerUser->getDisplayName();
}
if ($row['permissions'] > 0) {
diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php
index 8f342281adb..9c877f22a46 100644
--- a/lib/private/legacy/user.php
+++ b/lib/private/legacy/user.php
@@ -312,6 +312,8 @@ class OC_User {
*
* @param string $uid
* @return string|bool uid or false
+ * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method
+ * get() of \OCP\IUserManager - \OC::$server->getUserManager()
*/
public static function getDisplayName($uid = null) {
if ($uid) {
@@ -367,25 +369,6 @@ class OC_User {
}
/**
- * Get a list of all users
- *
- * @return array an array of all uids
- *
- * Get a list of all users.
- * @param string $search
- * @param integer $limit
- * @param integer $offset
- */
- public static function getUsers($search = '', $limit = null, $offset = null) {
- $users = \OC::$server->getUserManager()->search($search, $limit, $offset);
- $uids = array();
- foreach ($users as $user) {
- $uids[] = $user->getUID();
- }
- return $uids;
- }
-
- /**
* Get a list of all users display name
*
* @param string $search