Merge pull request #55388 from nextcloud/fix/remove-unused-methods-of-oc-user

chore: Remove unused deprecated methods from OC_User and Filesystem
pull/55396/head
Côme Chilliet 1 week ago committed by GitHub
commit 09d7ddadf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 24
      lib/private/Files/Filesystem.php
  2. 46
      lib/private/legacy/OC_User.php

@ -389,30 +389,6 @@ class Filesystem {
self::$mounts->addMount($mount);
}
/**
* return the path to a local version of the file
* we need this because we can't know if a file is stored local or not from
* outside the filestorage and for some purposes a local file is needed
*/
public static function getLocalFile(string $path): string|false {
return self::$defaultInstance->getLocalFile($path);
}
/**
* return path to file which reflects one visible in browser
*
* @param string $path
* @return string
*/
public static function getLocalPath($path) {
$datadir = \OC_User::getHome(\OC_User::getUser()) . '/files';
$newpath = $path;
if (strncmp($newpath, $datadir, strlen($datadir)) == 0) {
$newpath = substr($path, strlen($datadir));
}
return $newpath;
}
/**
* check if the requested path is valid
*

@ -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.
*

Loading…
Cancel
Save