aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/External/Manager.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: Add SPDX headerAndy Scherzinger2024-06-061-30/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* Merge pull request #39044 from nextcloud/more-empty-mount-checkingRobin Appelman2023-10-241-0/+4
|\ | | | | Fix root mounts not being setup in some cases
| * add more checks to ensure mounts aren't emptyRobin Appelman2023-09-121-0/+4
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Convert isset ternary to null coalescing operatorHamid Dehnavi2023-09-281-1/+1
|/ | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* Avoid extra parenthesis around SQL in IN expressionsCôme Chilliet2023-02-211-5/+5
| | | | | | | | The expression builder already suround the SQL with parenthesis when using in(), so we must not add another pair, this confuses at least sqlite. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix various other small psalm issuesCarl Schwan2022-10-171-5/+2
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* invalidate mount cache after accepting or renaming federated shareRobin Appelman2022-03-251-0/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* adjust tests to new fs setupRobin Appelman2022-03-041-2/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* move files_sharing to IBootStrapRobin Appelman2021-10-191-14/+17
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Let users choose a share_folderHinrich Mahler2021-09-061-1/+1
|
* Fix remote share deletion when deleting userVincent Petry2021-07-271-23/+54
| | | | | | | When deleting a user, we should only delete the direct remote user shares or the remote group based subshares. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Replace ILogger with LoggerInterface in remote share managerVincent Petry2021-07-271-10/+10
| | | | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com> Co-authored-by: Carl Schwan <carl@carlschwan.eu>
* Fix remote group share decline+accept code pathVincent Petry2021-07-271-1/+7
| | | | | | | | When declining a remote group share through the dialog that appears when notifications are off, the mount point is now correctly saved when re-accepting. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix external share manager with multiple user groupsVincent Petry2021-07-271-8/+15
| | | | | | Use query builder with proper matching for finding the group names. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix remote group share API interactionsVincent Petry2021-07-271-8/+36
| | | | | | | | | | Accepting and declining can now be done repeatedly on both the parent group share and sub-share with the same effects. Added unit tests to cover these cases, and also when the same operation is repeated. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix re-accepting or re-rejecting remote group sharesVincent Petry2021-07-271-42/+97
| | | | | | | | | | | | | When accepting a group share, a sub-share entry is created which also has a different id. When accepting or rejecting the sub-share, simply update the "accepted" flag instead of trying to re-insert the entry. Adjust getShare to also properly validate group share membership when called on a sub-share id. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Add logging to external shares managerVincent Petry2021-07-271-13/+24
| | | | | | | Instead of just returning false, also log the exception to make debugging database issues easier. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix received federated group sharesVincent Petry2021-07-271-9/+41
| | | | | | | | | | | | Fix pending shares endpoint to consider user-specific sub-entries for group shares whenever a share was accepted or declined. Added unit test for adding remote group shares. Fixed "removeUserShares" to not send a remote request as we never send remote requests for group shares. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Correctly check the reception of a remote feedbackLouis Chemineau2021-06-091-2/+2
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-81/+105
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Adjust defaultJulius Härtl2020-12-081-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Move remoteId of remote reshares to stringJulius Härtl2020-12-081-3/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Improve CertificateManager to not be user context dependentMorris Jobke2020-11-031-1/+1
| | | | | | | | | * removes the ability for users to import their own certificates (for external storage) * reliably returns the same certificate bundles system wide (and not depending on the user context and available sessions) The user specific certificates were broken in some cases anyways, as they are only loaded if the specific user is logged in and thus causing unexpected behavior for background jobs and other non-user triggered code paths. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-17/+17
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for Nextcloud 20 (again)Christoph Wurst2020-09-071-0/+1
| | | | | | | There are still lots of outdated headers, so time for another round of updates. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Do not fail if share for mountpoint is no longer availableJulius Härtl2020-09-031-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* 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>
* 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>
* Add visibility to all constantsChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-12/+5
| | | | | | | | | | | | | | | 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-101-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-13/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+1
| | | | 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>
* 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>
* 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>
* 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 ::class statement instead of stringMorris Jobke2018-01-291-1/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>