|
|
|
@ -250,16 +250,6 @@ class OC_User { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Check if the user is logged in, considers also the HTTP basic credentials |
|
|
|
|
* |
|
|
|
|
* @deprecated 12.0.0 use \OC::$server->getUserSession()->isLoggedIn() |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
public static function isLoggedIn() { |
|
|
|
|
return \OC::$server->getUserSession()->isLoggedIn(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* set incognito mode, e.g. if a user wants to open a public link |
|
|
|
|
* |
|
|
|
@ -350,42 +340,6 @@ class OC_User { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param string $uid The username |
|
|
|
|
* @return string |
|
|
|
|
* |
|
|
|
|
* returns the path to the users home directory |
|
|
|
|
* @deprecated 12.0.0 Use \OC::$server->getUserManager->getHome() |
|
|
|
|
*/ |
|
|
|
|
public static function getHome($uid) { |
|
|
|
|
$user = Server::get(IUserManager::class)->get($uid); |
|
|
|
|
if ($user) { |
|
|
|
|
return $user->getHome(); |
|
|
|
|
} else { |
|
|
|
|
return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get a list of all users display name |
|
|
|
|
* |
|
|
|
|
* @param string $search |
|
|
|
|
* @param int $limit |
|
|
|
|
* @param int $offset |
|
|
|
|
* @return array associative array with all display names (value) and corresponding uids (key) |
|
|
|
|
* |
|
|
|
|
* Get a list of all display names and user ids. |
|
|
|
|
* @deprecated 12.0.0 Use \OC::$server->getUserManager->searchDisplayName($search, $limit, $offset) instead. |
|
|
|
|
*/ |
|
|
|
|
public static function getDisplayNames($search = '', $limit = null, $offset = null) { |
|
|
|
|
$displayNames = []; |
|
|
|
|
$users = Server::get(IUserManager::class)->searchDisplayName($search, $limit, $offset); |
|
|
|
|
foreach ($users as $user) { |
|
|
|
|
$displayNames[$user->getUID()] = $user->getDisplayName(); |
|
|
|
|
} |
|
|
|
|
return $displayNames; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the first active backend from self::$_usedBackends. |
|
|
|
|
* |
|
|
|
|