summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-02-16 11:56:07 +0100
committerMorris Jobke <hey@morrisjobke.de>2021-05-21 15:00:34 +0200
commit81964200639c585ff523c6303fdb99eb0c7c180c (patch)
treedb98b7db0ac8f8b7ba095db611fa65bf92836d13 /apps/files_trashbin/lib
parent7ffee26aa8768736593c77dcb12d17978a6e06b2 (diff)
downloadnextcloud-server-81964200639c585ff523c6303fdb99eb0c7c180c.tar.gz
nextcloud-server-81964200639c585ff523c6303fdb99eb0c7c180c.zip
Drop \OCP\User
Inlines and remaining usages and drops the deprecated public API. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r--apps/files_trashbin/lib/Hooks.php2
-rw-r--r--apps/files_trashbin/lib/Trashbin.php16
2 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_trashbin/lib/Hooks.php b/apps/files_trashbin/lib/Hooks.php
index 74f1fde9737..8bf8fa8dc94 100644
--- a/apps/files_trashbin/lib/Hooks.php
+++ b/apps/files_trashbin/lib/Hooks.php
@@ -44,7 +44,7 @@ class Hooks {
}
public static function post_write_hook($params) {
- $user = \OCP\User::getUser();
+ $user = \OC_User::getUser();
if (!empty($user)) {
Trashbin::resizeTrash($user);
}
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 01ee260985c..8b2b8b2d953 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -45,6 +45,7 @@
namespace OCA\Files_Trashbin;
+use OC_User;
use OC\Files\Cache\Cache;
use OC\Files\Cache\CacheEntry;
use OC\Files\Cache\CacheQueryBuilder;
@@ -60,7 +61,6 @@ use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
-use OCP\User;
class Trashbin {
@@ -103,14 +103,14 @@ class Trashbin {
// to a remote user with a federated cloud ID we use the current logged-in
// user. We need a valid local user to move the file to the right trash bin
if (!$userManager->userExists($uid)) {
- $uid = User::getUser();
+ $uid = OC_User::getUser();
}
if (!$uid) {
// no owner, usually because of share link from ext storage
return [null, null];
}
Filesystem::initMountPoints($uid);
- if ($uid !== User::getUser()) {
+ if ($uid !== OC_User::getUser()) {
$info = Filesystem::getFileInfo($filename);
$ownerView = new View('/' . $uid . '/files');
try {
@@ -390,7 +390,7 @@ class Trashbin {
*/
private static function retainVersions($filename, $owner, $ownerPath, $timestamp) {
if (\OCP\App::isEnabled('files_versions') && !empty($ownerPath)) {
- $user = User::getUser();
+ $user = OC_User::getUser();
$rootView = new View('/');
if ($rootView->is_dir($owner . '/files_versions/' . $ownerPath)) {
@@ -464,7 +464,7 @@ class Trashbin {
* @return bool true on success, false otherwise
*/
public static function restore($file, $filename, $timestamp) {
- $user = User::getUser();
+ $user = OC_User::getUser();
$view = new View('/' . $user);
$location = '';
@@ -538,7 +538,7 @@ class Trashbin {
*/
private static function restoreVersions(View $view, $file, $filename, $uniqueFilename, $location, $timestamp) {
if (\OCP\App::isEnabled('files_versions')) {
- $user = User::getUser();
+ $user = OC_User::getUser();
$rootView = new View('/');
$target = Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename);
@@ -574,7 +574,7 @@ class Trashbin {
* delete all files from the trash
*/
public static function deleteAll() {
- $user = User::getUser();
+ $user = OC_User::getUser();
$userRoot = \OC::$server->getUserFolder($user)->getParent();
$view = new View('/' . $user);
$fileInfos = $view->getDirectoryContent('files_trashbin/files');
@@ -725,7 +725,7 @@ class Trashbin {
* @return bool true if file exists, otherwise false
*/
public static function file_exists($filename, $timestamp = null) {
- $user = User::getUser();
+ $user = OC_User::getUser();
$view = new View('/' . $user);
if ($timestamp) {