summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/External
Commit message (Collapse)AuthorAgeFilesLines
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* When no user is logged in null is usedJoas Schilling2020-07-291-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Move federated_share_added into a typed eventMorris Jobke2020-07-231-36/+17
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Pass $path to ocmPermissions2ncPermissionsDaniel Kesselberg2020-06-251-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update share type constant usageJoas Schilling2020-06-241-7/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Do not only catch Exceptions but any Throwable during rmt share deleteChristoph Wurst2020-06-021-2/+2
| | | | | | | | | | When a remote share is deleted, we notify the remove instance. This may trigger various error conditions, which we want to catch in order to avoid undeletable shares. The try-catch, however, did only capture exceptions, so things like TypeErrors were not caught and caused the process to fail hard. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for 19Christoph Wurst2020-04-292-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add method to storage backends to get directory content with metadataRobin Appelman2020-04-201-1/+1
| | | | | | | | | | | | | | | | | Currently you need to use `opendir` and then call `getMetadata` for every file, which adds overhead because most storage backends already get the metadata when doing the `opendir`. While storagebackends can (and do) use caching to relief this problem, this adds cache invalidation dificulties and only a limited number of items are generally cached (to prevent memory usage exploding when scanning large storages) With this new methods storage backends can use the child metadata they got from listing the folder to return metadata without having to keep seperate caches. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add visibility to all constantsChristoph Wurst2020-04-102-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-103-17/+10
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-102-4/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-312-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-262-15/+15
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-057-7/+8
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* FixesRoeland Jago Douma2019-11-181-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Respect the accepted flag for group and user sharesJoas Schilling2019-11-121-1/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix unnecessary boolean castMorris Jobke2019-03-061-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #13790 from fretn/masterMorris Jobke2019-03-061-1/+1
|\ | | | | Fix for crashing occ files:scan
| * Fix for crashing occ files:scanfretn2019-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $share === false then (int)$share['share_type'] will always be equal to (int)0 which results in following crash: [root@server nextcloud] sudo -u apache php occ files:scan someuser The current PHP memory limit is below the recommended value of 512MB. Starting scan for user 1 out of 1 (someuser) An unhandled exception has been thrown: TypeError: Argument 1 passed to OC\OCS\DiscoveryService::discover() must be of the type string, null given, called in /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php on line 382 and defined in /var/www/html/nextcloud/lib/private/OCS/DiscoveryService.php:65 Stack trace: 0 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(382): OC\OCS\DiscoveryService->discover(NULL, 'FEDERATED_SHARI...') 1 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(527): OCA\Files_Sharing\External\Manager->sendFeedbackToRemote(NULL, NULL, NULL, 'decline') 2 /var/www/html/nextcloud/apps/files_sharing/lib/External/Storage.php(216): OCA\Files_Sharing\External\Manager->removeShare('files/Someth...') 3 [internal function]: OCA\Files_Sharing\External\Storage->checkStorageAvailability() 4 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array) 5 [internal function]: OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array) 6 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array) 7 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(89): OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array) 8 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(44): OCA\Files_Sharing\External\Scanner->scanAll() 9 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(245): OCA\Files_Sharing\External\Scanner->scan('', true, 3) 10 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(172): OC\Files\Utils\Scanner->scan('/someuser', true, NULL) 11 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(249): OCA\Files\Command\Scan->scanFiles('someuser', '/someuser', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false) 12 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 13 /var/www/html/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 14 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 17 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 18 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run() 19 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...') 20 {main}[root@server nextcloud] Signed-off-by: fretn <frederikdelaere+github@gmail.com>
* | Catch Request exception in testRemoteUrlRoeland Jago Douma2019-02-151-0/+3
|/ | | | | | | Else the background job fails hard if the remote has for example an invalid certificate. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add interface to allow storages from opting out of encryptionRobin Appelman2018-11-291-1/+2
| | | | | | As opposed to hard-coding a list of excluded storages Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix unit testsBjoern Schiessle2018-07-111-1/+1
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* update unit testsBjoern Schiessle2018-07-111-4/+4
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* unshare from selfBjoern Schiessle2018-07-111-10/+15
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* accept/decline group sharesBjoern Schiessle2018-07-111-15/+92
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* implement federated group sharesBjoern Schiessle2018-07-111-8/+23
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* look for correct OCM permissionsBjoern Schiessle2018-07-021-6/+56
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* implement decline shareBjoern Schiessle2018-07-021-1/+16
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* adjust to latest api versionBjoern Schiessle2018-07-021-4/+8
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* send accept share notification (WIP)Bjoern Schiessle2018-07-021-0/+45
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Use an actual function of the storage to determine needsPartFileRoeland Jago Douma2018-05-011-0/+3
| | | | | | | We have a function for it so better to override that. Also because other codes that might check this should get the right value. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use ::class statement instead of stringMorris Jobke2018-01-291-1/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* return correct mount type for federated sharesBjoern Schiessle2018-01-111-0/+10
| | | | | | fix https://github.com/nextcloud/server/issues/6584 Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Also replace all other occurencesMorris Jobke2017-12-181-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Also cache invalid DiscoveryService responseRoeland Jago Douma2017-12-131-1/+1
| | | | | | | | * Cache it for a day so we will retry eventually * Cache the status.php response as well so we will try it once a day as well Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headersMorris Jobke2017-11-063-0/+5
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #5823 from nextcloud/improve-error-handlingMorris Jobke2017-07-211-8/+11
|\ | | | | Improve error handling for accepting federated shares
| * improved error handlingBjoern Schiessle2017-07-211-8/+11
| | | | | | | | | | | | | | check if table was updated successfully and only then send a notification mail and return "true". Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | still remove the federated share even if we cant notify the remoteRobin Appelman2017-07-171-2/+7
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Use the share_folder config for remote sharesJoas Schilling2017-06-131-2/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix for sharingDaniel Hansson2017-05-201-0/+1
| | | | Signed-off-by: Daniel Hansson <daniel@techandme.se>
* Remove unused use statementsMorris Jobke2017-04-222-2/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #3614 from nextcloud/discover-federatedsharing-endpointsBjörn Schießle2017-04-122-22/+29
|\ | | | | Discover federatedsharing endpoints
| * Do proper DIRoeland Jago Douma2017-04-111-1/+1
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
| * remove discovery manager in favour of the OCSDiscoveryServiceBjoern Schiessle2017-04-112-22/+29
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | Update comments to NextcloudMorris Jobke2017-04-111-4/+4
|/ | | | | | | * based on PR by @Ardinis * see #4311 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add a single public api for resolving a cloud id to a user and remote and backRobin Appelman2017-02-083-25/+35
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Inject IHTTPClientServiceLukas Reschke2016-09-292-2/+3
| | | | | | | | | | Otherwise the unit test execution will do a ton of external HTTP requests which fail and then timeout… See https://blackfire.io/profiles/compare/3c67acfa-a11e-4aec-bcd4-c945b006f01e/graph for reference Pretty similar to https://github.com/nextcloud/server/pull/1565 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Fix fed share test call to return proper resultVincent Petry2016-09-201-1/+1
| | | | | | Fixes an issue where retrying a previously failed federated share would not properly reset the availability flag because the return value was undefined instead of "true".
* HTTPHelper is deprecatedRoeland Jago Douma2016-08-241-8/+22
| | | | Use the IClientService instead