diff options
-rw-r--r-- | appinfo/app.php | 3 | ||||
-rw-r--r-- | css/circles.filelist.css | 39 | ||||
-rw-r--r-- | css/files/circles.filelist.css | 54 | ||||
-rw-r--r-- | files/list.php | 6 | ||||
-rw-r--r-- | js/files/circles.files.app.js (renamed from js/circles.files.app.js) | 0 | ||||
-rw-r--r-- | js/files/circles.files.list.js (renamed from js/circles.files.list.js) | 30 | ||||
-rw-r--r-- | lib/Api/v1/Circles.php | 18 | ||||
-rw-r--r-- | lib/AppInfo/Application.php | 138 | ||||
-rw-r--r-- | lib/Db/CircleProviderRequest.php | 106 | ||||
-rw-r--r-- | lib/Db/CircleProviderRequestBuilder.php | 7 | ||||
-rw-r--r-- | lib/Service/CirclesService.php | 33 | ||||
-rw-r--r-- | lib/ShareByCircleProvider.php | 95 | ||||
-rw-r--r-- | list.php | 26 | ||||
-rw-r--r-- | templates/files/list.php (renamed from templates/list.php) | 0 |
14 files changed, 294 insertions, 261 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index e5ecc442..f4bb8455 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -28,8 +28,9 @@ $app = new \OCA\Circles\AppInfo\Application(); -$app->registerNavigation(); $app->registerSettingsAdmin(); +$app->registerNavigation(); +$app->registerFilesNavigation(); $app->registerFilesPlugin(); diff --git a/css/circles.filelist.css b/css/circles.filelist.css deleted file mode 100644 index 468482ca..00000000 --- a/css/circles.filelist.css +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 - * - * This file is licensed under the Affero General Public License version 3 - * or later. - * - * See the COPYING-README file. - * - */ -#app-content-circlesfilter .select2-container { - width: 30%; - margin-left: 10px; -} - -#app-content-circlesfilter .select2-choices { - white-space: nowrap; - text-overflow: ellipsis; - background: #fff; - color: #555; - box-sizing: content-box; - border-radius: 3px; - border: 1px solid #ddd; - padding: 0; - min-height: auto; -} - -.nav-icon-circlesfilter { - background-image: url('../img/black_circle.svg'); -} - -#app-sidebar .mainFileInfoView .tag-label { - cursor: pointer; - padding: 13px; -} - -#app-sidebar .mainFileInfoView .icon-tag { - opacity: .5; - vertical-align: middle; -} diff --git a/css/files/circles.filelist.css b/css/files/circles.filelist.css new file mode 100644 index 00000000..c2f42cb3 --- /dev/null +++ b/css/files/circles.filelist.css @@ -0,0 +1,54 @@ +/* + * Circles - Bring cloud-users closer together. + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +#app-content-circlesfilter .select2-container { + width: 30%; + margin-left: 10px; +} + +#app-content-circlesfilter .select2-choices { + white-space: nowrap; + text-overflow: ellipsis; + background: #fff; + color: #555; + box-sizing: content-box; + border-radius: 3px; + border: 1px solid #ddd; + padding: 0; + min-height: auto; +} + +.nav-icon-circlesfilter { + background-image: url('../../img/black_circle.svg'); +} + +#app-sidebar .mainFileInfoView .tag-label { + cursor: pointer; + padding: 13px; +} + +#app-sidebar .mainFileInfoView .icon-tag { + opacity: .5; + vertical-align: middle; +} diff --git a/files/list.php b/files/list.php new file mode 100644 index 00000000..70e82b1f --- /dev/null +++ b/files/list.php @@ -0,0 +1,6 @@ +<?php + +OCP\User::checkLoggedIn(); + +$tmpl = new OCP\Template('circles', 'files/list', ''); +$tmpl->printPage(); diff --git a/js/circles.files.app.js b/js/files/circles.files.app.js index 431b7868..431b7868 100644 --- a/js/circles.files.app.js +++ b/js/files/circles.files.app.js diff --git a/js/circles.files.list.js b/js/files/circles.files.list.js index 71be1d51..89bc2e95 100644 --- a/js/circles.files.list.js +++ b/js/files/circles.files.list.js @@ -1,13 +1,25 @@ /* - * Copyright (c) 2017 EITA Cooperative + * Circles - Bring cloud-users closer together. * - * @author Vinicius Brand <vinicius@eita.org.br> - * @author Daniel Tygel <daniel@eita.org.br> + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. * - * This file is licensed under the Affero General Public License version 3 - * or later. + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2017 + * @license GNU AGPL version 3 or any later version * - * See the COPYING-README file. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ (function() { @@ -146,7 +158,7 @@ return m; }, formatNoMatches: function() { - return t('systemtags', 'No tags found'); + return t('systemtags', 'No circles found'); } }); this.$filterField.on('change', _.bind(this._onTagsChanged, this)); @@ -211,11 +223,11 @@ if (!this._circlesIds.length) { // no tags selected this.$el.find('#emptycontent').html('<div class="icon-systemtags"></div>' + - '<h2>' + t('systemtags', 'Please select tags to filter by') + '</h2>'); + '<h2>' + t('systemtags', 'Please select circles to filter by') + '</h2>'); } else { // tags selected but no results this.$el.find('#emptycontent').html('<div class="icon-systemtags"></div>' + - '<h2>' + t('systemtags', 'No files found for the selected tags') + '</h2>'); + '<h2>' + t('systemtags', 'No files found for the selected circles') + '</h2>'); } this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty); this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty); diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php index dced9d7f..bbb08d9e 100644 --- a/lib/Api/v1/Circles.php +++ b/lib/Api/v1/Circles.php @@ -452,24 +452,16 @@ class Circles { /** * Get a list of objects which are shred with $circleUniqueId. * - * @param string|array $tagIds Tag id or array of tag ids. - * @param string $objectType object type - * @param int $limit Count of object ids you want to get - * @param string $offset The last object id you already received + * @since 0.14.0 * - * @return string[] array of object ids or empty array if none found - * - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the - * given tags does not exist - * @throws \InvalidArgumentException When a limit is specified together with - * multiple tag ids + * @param array $circleUniqueIds * - * @since 9.0.0 + * @return string[] array of object ids or empty array if none found */ - public static function getObjectIdsForCircles($circleUniqueIds) { + public static function getFilesForCircles($circleUniqueIds) { $c = self::getContainer(); return $c->query(CirclesService::class) - ->getObjectIdsForCircles($circleUniqueIds); + ->getFilesForCircles($circleUniqueIds); } }
\ No newline at end of file diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 27b2c001..a0c95821 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -29,33 +29,13 @@ namespace OCA\Circles\AppInfo; -use OCA\Circles\Controller\FederatedController; -use OCA\Circles\Controller\GroupsController; -use OCA\Circles\Controller\NavigationController; -use OCA\Circles\Controller\CirclesController; -use OCA\Circles\Controller\MembersController; - - -use OCA\Circles\Controller\SettingsController; -use OCA\Circles\Controller\SharesController; -use OCA\Circles\Db\CirclesRequest; -use OCA\Circles\Db\FederatedLinksRequest; -use OCA\Circles\Db\MembersRequest; -use OCA\Circles\Events\UserEvents; -use OCA\Circles\Service\BroadcastService; -use OCA\Circles\Service\CirclesService; -use OCA\Circles\Service\EventsService; -use OCA\Circles\Service\FederatedLinkService; -use OCA\Circles\Service\GroupsService; -use OCA\Circles\Service\MembersService; -use OCA\Circles\Service\ConfigService; -use OCA\Circles\Service\MiscService; -use OCA\Circles\Service\SearchService; -use OCA\Circles\Service\SharingFrameService; +use OCA\Circles\Api\v1\Circles; +use OCA\Files\App as FilesApp; use OCP\AppFramework\App; use OCP\AppFramework\IAppContainer; use OCP\Util; + class Application extends App { const APP_NAME = 'circles'; @@ -65,17 +45,18 @@ class Application extends App { const CLIENT_TIMEOUT = 3; + /** @var IAppContainer */ + private $container; + /** * @param array $params */ public function __construct(array $params = array()) { parent::__construct(self::APP_NAME, $params); - $container = $this->getContainer(); + $this->container = $this->getContainer(); - // TODO: POURQUOI SELF:: ??!?? - self::registerEvents($container); - self::registerHooks(); + $this->registerHooks(); } @@ -93,58 +74,31 @@ class Application extends App { /** - * Register Events - * - * @param IAppContainer $container - */ - public function registerEvents(IAppContainer $container) { -// $container->registerService( -// 'UserEvents', function(IAppContainer $c) { -// return new UserEvents( -// $c->query('MembersService'), $c->query('GroupsService'), $c->query('MiscService') -// ); -// } -// ); - } - - - /** * Register Navigation elements */ public function registerNavigation() { - // Register Navigation Tab - $this->getContainer() - ->getServer() - ->getNavigationManager() - ->add( - function() { - $urlGen = \OC::$server->getURLGenerator(); - $navName = \OC::$server->getL10N(self::APP_NAME) - ->t('Circles'); - - return [ - 'id' => self::APP_NAME, - 'order' => 5, - 'href' => $urlGen->linkToRoute('circles.Navigation.navigate'), - 'icon' => $urlGen->imagePath(self::APP_NAME, 'circles.svg'), - 'name' => $navName - ]; - } - ); - - // Register Navigation in FileList - \OCA\Files\App::getNavigationManager()->add(function () { - $l = \OC::$server->getL10N('circles'); - return [ - 'id' => 'circlesfilter', - 'appname' => 'circles', - 'script' => 'list.php', - 'order' => 25, - 'name' => $l->t('Circles'), - ]; - }); + + $appManager = $this->container->getServer() + ->getNavigationManager(); + $appManager->add( + function() { + $urlGen = \OC::$server->getURLGenerator(); + $navName = \OC::$server->getL10N(self::APP_NAME) + ->t('Circles'); + + return [ + 'id' => self::APP_NAME, + 'order' => 5, + 'href' => $urlGen->linkToRoute('circles.Navigation.navigate'), + 'icon' => $urlGen->imagePath(self::APP_NAME, 'circles.svg'), + 'name' => $navName + ]; + } + ); + } + public function registerSettingsAdmin() { \OCP\App::registerAdmin(self::APP_NAME, 'lib/admin'); } @@ -154,19 +108,37 @@ class Application extends App { $eventDispatcher->addListener( 'OCA\Files::loadAdditionalScripts', function() { - // FIXME: no public API for these ? - \OCP\Util::addScript('circles', 'circles.v1.circles'); - \OCP\Util::addScript('circles', 'circles.v1.links'); - \OCP\Util::addScript('circles', 'circles.v1.members'); - \OCP\Util::addScript('circles', 'circles.v1'); + Circles::addJavascriptAPI(); + + Util::addScript('circles', 'files/circles.files.app'); + Util::addScript('circles', 'files/circles.files.list'); + + Util::addStyle('circles', 'files/circles.filelist'); + } + ); + } - \OCP\Util::addScript('circles', 'circles.files.app'); - \OCP\Util::addScript('circles', 'circles.files.list'); - \OCP\Util::addStyle('circles'); - \OCP\Util::addStyle('circles', 'circles.filelist'); + /** + * + */ + public function registerFilesNavigation() { + + $appManager = FilesApp::getNavigationManager(); + $appManager->add( + function() { + $l = \OC::$server->getL10N('circles'); + + return [ + 'id' => 'circlesfilter', + 'appname' => 'circles', + 'script' => 'files/list.php', + 'order' => 25, + 'name' => $l->t('Shared to Circles'), + ]; } ); } + } diff --git a/lib/Db/CircleProviderRequest.php b/lib/Db/CircleProviderRequest.php new file mode 100644 index 00000000..5b5af1b2 --- /dev/null +++ b/lib/Db/CircleProviderRequest.php @@ -0,0 +1,106 @@ +<?php +/** + * Circles - Bring cloud-users closer together. + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + + +namespace OCA\Circles\Db; + + +use OCA\Circles\Model\Member; + +class CircleProviderRequest extends CircleProviderRequestBuilder { + + + /** + * @param $userId + * @param $circleUniqueIds + * @param $limit + * @param $offset + * + * @return array + */ + public function getFilesForCircles($userId, $circleUniqueIds, $limit, $offset) { + + $qb = $this->getCompleteSelectSql(); + $this->linkToFileCache($qb, $userId); + $this->limitToPage($qb, $limit, $offset); + $this->limitToCircles($qb, $circleUniqueIds); + + $this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed()); + + $this->leftJoinShareInitiator($qb); + $cursor = $qb->execute(); + + $object_ids = []; + while ($data = $cursor->fetch()) { + + if ($data['initiator_circle_level'] < Member::LEVEL_MEMBER + && ($data['initiator_group_level'] < Member::LEVEL_MEMBER + || !$this->configService->isLinkedGroupsAllowed()) + ) { + continue; + } + + self::editShareFromParentEntry($data); + if (self::isAccessibleResult($data)) { + $object_ids[] = $data['file_source']; + } + } + $cursor->closeCursor(); + + return $object_ids; + } + + + /** + * Returns whether the given database result can be interpreted as + * a share with accessible file (not trashed, not deleted) + * + * @param $data + *F + * + * @return bool + */ + protected static function isAccessibleResult($data) { + if ($data['fileid'] === null) { + return false; + } + + return (!(explode('/', $data['path'], 2)[0] !== 'files' + && explode(':', $data['storage_string_id'], 2)[0] === 'home')); + } + + + /** + * @param $data + */ + protected static function editShareFromParentEntry(&$data) { + if ($data['parent_id'] > 0) { + $data['permissions'] = $data['parent_perms']; + $data['file_target'] = $data['parent_target']; + } + } + +}
\ No newline at end of file diff --git a/lib/Db/CircleProviderRequestBuilder.php b/lib/Db/CircleProviderRequestBuilder.php index d37c65fd..2fb98ad9 100644 --- a/lib/Db/CircleProviderRequestBuilder.php +++ b/lib/Db/CircleProviderRequestBuilder.php @@ -35,15 +35,10 @@ use Doctrine\DBAL\Query\QueryBuilder; use OCA\Circles\Model\Circle; use OCA\Circles\Model\Member; use OCP\DB\QueryBuilder\IQueryBuilder; -use OCP\IDBConnection; use OCP\Share; use OCP\Share\IShare; -class CircleProviderRequestBuilder { - - - /** @var IDBConnection */ - protected $dbConnection; +class CircleProviderRequestBuilder extends CoreRequestBuilder { /** diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 2836f4fa..ecf0097d 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -31,13 +31,13 @@ namespace OCA\Circles\Service; use OCA\Circles\AppInfo\Application; +use OCA\Circles\Db\CircleProviderRequest; use OCA\Circles\Db\CirclesRequest; use OCA\Circles\Db\FederatedLinksRequest; use OCA\Circles\Db\MembersRequest; use OCA\Circles\Exceptions\CircleAlreadyExistsException; use OCA\Circles\Exceptions\CircleTypeDisabledException; use OCA\Circles\Exceptions\FederatedCircleNotAllowedException; -use OCA\Circles\Exceptions\MemberDoesNotExistException; use OCA\Circles\Exceptions\MemberIsNotOwnerException; use OCA\Circles\Model\Circle; use OCA\Circles\Model\Member; @@ -67,12 +67,12 @@ class CirclesService { /** @var EventsService */ private $eventsService; + /** @var CircleProviderRequest */ + private $circleProviderRequest; + /** @var MiscService */ private $miscService; - /** @var ShareByCircleProvider */ - private $shareProvider; - /** * CirclesService constructor. @@ -84,6 +84,7 @@ class CirclesService { * @param MembersRequest $membersRequest * @param FederatedLinksRequest $federatedLinksRequest * @param EventsService $eventsService + * @param CircleProviderRequest $circleProviderRequest * @param MiscService $miscService */ public function __construct( @@ -94,8 +95,8 @@ class CirclesService { MembersRequest $membersRequest, FederatedLinksRequest $federatedLinksRequest, EventsService $eventsService, - MiscService $miscService, - ShareByCircleProvider $shareProvider + CircleProviderRequest $circleProviderRequest, + MiscService $miscService ) { $this->userId = $userId; $this->l10n = $l10n; @@ -104,8 +105,8 @@ class CirclesService { $this->membersRequest = $membersRequest; $this->federatedLinksRequest = $federatedLinksRequest; $this->eventsService = $eventsService; + $this->circleProviderRequest = $circleProviderRequest; $this->miscService = $miscService; - $this->shareProvider = $shareProvider; } @@ -302,7 +303,9 @@ class CirclesService { try { $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); - $member = $this->membersRequest->getFreshNewMember($circleUniqueId, $this->userId, Member::TYPE_USER); + $member = $this->membersRequest->getFreshNewMember( + $circleUniqueId, $this->userId, Member::TYPE_USER + ); $member->hasToBeAbleToJoinTheCircle(); $member->joinCircle($circle->getType()); $this->membersRequest->updateMember($member); @@ -444,12 +447,22 @@ class CirclesService { return $urlGen->getAbsoluteURL($urlGen->imagePath(Application::APP_NAME, 'black_circle' . $ext)); } - public function getObjectIdsForCircles($circleUniqueIds, $limit = -1, $offset = 0) { + + /** + * @param string $circleUniqueIds + * @param int $limit + * @param int $offset + * + * @return array + */ + public function getFilesForCircles($circleUniqueIds, $limit = -1, $offset = 0) { if (!is_array($circleUniqueIds)) { $circleUniqueIds = [$circleUniqueIds]; } - $objectIds = $this->shareProvider->getObjectIdsForCircles($this->userId, $circleUniqueIds, $limit, $offset); + $objectIds = $this->circleProviderRequest->getFilesForCircles( + $this->userId, $circleUniqueIds, $limit, $offset + ); return $objectIds; } diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php index 82ef21cb..06ddae47 100644 --- a/lib/ShareByCircleProvider.php +++ b/lib/ShareByCircleProvider.php @@ -36,7 +36,7 @@ use OC\Share20\Exception\InvalidShare; use OC\Share20\Share; use OCA\Circles\Api\v1\Circles; use OCA\Circles\AppInfo\Application; -use OCA\Circles\Db\CircleProviderRequestBuilder; +use OCA\Circles\Db\CircleProviderRequest; use OCA\Circles\Db\CirclesRequest; use OCA\Circles\Db\MembersRequest; use OCA\Circles\Model\Circle; @@ -58,7 +58,8 @@ use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IShare; use OCP\Share\IShareProvider; -class ShareByCircleProvider extends CircleProviderRequestBuilder implements IShareProvider { + +class ShareByCircleProvider extends CircleProviderRequest implements IShareProvider { /** @var IDBConnection */ protected $dbConnection; @@ -109,23 +110,20 @@ class ShareByCircleProvider extends CircleProviderRequestBuilder implements ISha IDBConnection $connection, ISecureRandom $secureRandom, IUserManager $userManager, IRootFolder $rootFolder, IL10N $l10n, ILogger $logger, IURLGenerator $urlGenerator ) { - $this->dbConnection = $connection; + $app = new Application(); + $container = $app->getContainer(); + $configService = $container->query(ConfigService::class); + $miscService = $container->query(MiscService::class); + + parent::__construct($l10n, $connection, $configService, $miscService); + $this->secureRandom = $secureRandom; $this->userManager = $userManager; $this->rootFolder = $rootFolder; - $this->l10n = $l10n; $this->logger = $logger; $this->urlGenerator = $urlGenerator; - - $app = new Application(); - $this->circlesRequest = $app->getContainer() - ->query(CirclesRequest::class); - $this->membersRequest = $app->getContainer() - ->query(MembersRequest::class); - $this->configService = $app->getContainer() - ->query(ConfigService::class); - $this->miscService = $app->getContainer() - ->query(MiscService::class); + $this->circlesRequest = $container->query(CirclesRequest::class); + $this->membersRequest = $container->query(MembersRequest::class); } @@ -450,6 +448,15 @@ class ShareByCircleProvider extends CircleProviderRequestBuilder implements ISha } + /** + * @param string $userId + * @param $shareType + * @param Node $node + * @param int $limit + * @param int $offset + * + * @return array + */ private function getSharedWithCircleMembers($userId, $shareType, $node, $limit, $offset) { $qb = $this->getCompleteSelectSql(); @@ -485,16 +492,6 @@ class ShareByCircleProvider extends CircleProviderRequestBuilder implements ISha return $shares; } - /** - * @param $data - */ - private static function editShareFromParentEntry(&$data) { - if ($data['parent_id'] > 0) { - $data['permissions'] = $data['parent_perms']; - $data['file_target'] = $data['parent_target']; - } - } - /** * Get a share by token @@ -538,37 +535,6 @@ class ShareByCircleProvider extends CircleProviderRequestBuilder implements ISha return $share; } - public function getObjectIdsForCircles($userId, $circleUniqueIds, $limit, $offset) { - - $qb = $this->getCompleteSelectSql(); - $this->linkToFileCache($qb, $userId); - $this->limitToPage($qb, $limit, $offset); - $this->limitToCircles($qb, $circleUniqueIds); - - $this->linkToMember($qb, $userId, $this->configService->isLinkedGroupsAllowed()); - - $this->leftJoinShareInitiator($qb); - $cursor = $qb->execute(); - - $object_ids = []; - while ($data = $cursor->fetch()) { - - if ($data['initiator_circle_level'] < Member::LEVEL_MEMBER - && ($data['initiator_group_level'] < Member::LEVEL_MEMBER - || !$this->configService->isLinkedGroupsAllowed()) - ) { - continue; - } - - self::editShareFromParentEntry($data); - if (self::isAccessibleResult($data)) { - $object_ids[] = $data['file_source']; - } - } - $cursor->closeCursor(); - - return $object_ids; - } /** * We don't return a thing about children. @@ -692,25 +658,6 @@ class ShareByCircleProvider extends CircleProviderRequestBuilder implements ISha /** - * Returns whether the given database result can be interpreted as - * a share with accessible file (not trashed, not deleted) - * - * @param $data - *F - * - * @return bool - */ - private static function isAccessibleResult($data) { - if ($data['fileid'] === null) { - return false; - } - - return (!(explode('/', $data['path'], 2)[0] !== 'files' - && explode(':', $data['storage_string_id'], 2)[0] === 'home')); - } - - - /** * @param IShare $share * * @return \Exception diff --git a/list.php b/list.php deleted file mode 100644 index 928751f9..00000000 --- a/list.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Vincent Petry <pvince81@owncloud.com> - * - * @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/> - * - */ -// Check if we are a user -OCP\User::checkLoggedIn(); - -$tmpl = new OCP\Template('circles', 'list', ''); -$tmpl->printPage(); diff --git a/templates/list.php b/templates/files/list.php index 841ce7b5..841ce7b5 100644 --- a/templates/list.php +++ b/templates/files/list.php |