aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Service/OwnershipTransferService.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: handle transfering the root of a mountpointtransfer-external-storageRobin Appelman14 days1-17/+28
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat: add option to include external storage when transfering filesRobin Appelman14 days1-13/+51
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat: improve occ file:transfer-ownership loggingenh/improve-transfer-ownership-logginggrnd-alt2025-03-061-0/+6
| | | | Signed-off-by: grnd-alt <github@belakkaf.net>
* Merge pull request #49761 from nextcloud/transfer-share-skip-notfoundDaniel2025-01-161-4/+13
|\ | | | | fix: skip transfering shares that we can't find
| * fix: skip transfering shares that we can't findtransfer-share-skip-notfoundRobin Appelman2025-01-031-4/+13
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: explicitly ignore nested mounts when transfering ownershipmount-move-checksRobin Appelman2025-01-061-1/+1
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(files_sharing,files): Do not validate shares before adjusting the ownerprovokateurin2024-11-251-2/+2
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* Merge pull request #47425 from ↵Côme Chilliet2024-11-041-10/+10
|\ | | | | | | | | nextcloud/fix/avoid-invalid-share-on-transfer-ownership fix: promote re-shares when deleting the parent share
| * fix: Transfer incomming shares first, do not delete non-migratable onesCôme Chilliet2024-10-141-13/+10
| | | | | | | | | | | | | | | | | | | | Canceling the previous add of deletion of invalid shares in transferownership because in some cases it deletes valid reshares, if incoming shares are not transfered on purpose. Inverting the order of transfer between incoming and outgoing so that reshare can be migrated when incoming shares are transfered. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * fix: delete re-shares when deleting the parent shareLuka Trovic2024-10-141-0/+3
| | | | | | | | | | | | | | Note: Removed part about fix command from original PR Signed-off-by: Luka Trovic <luka@nextcloud.com> Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | refactor(apps): Use constructor property promotion when possibleprovokateurin2024-10-211-6/+3
| | | | | | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* | refactor: Inject IRootFolderChristopher Ng2024-10-161-4/+4
| | | | | | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* | fix: Fix "Unknown path" error when source user `files` folder has not been ↵Christopher Ng2024-10-161-0/+2
| | | | | | | | | | | | initialized Signed-off-by: Christopher Ng <chrng8@gmail.com>
* | chore(apps): Apply new rector configuration to autouse classesCôme Chilliet2024-10-151-5/+8
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(transfer-ownership): Improve verbose output of commandCôme Chilliet2024-10-071-0/+2
| | | | | | Makes debbuging way easier Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(transfer-ownership): Improve comments according to code reviewCôme Chilliet2024-09-051-3/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(transfer-ownership): Correctly react to encrypted filesCôme Chilliet2024-09-051-20/+43
| | | | | | | | For E2EE encrypted files, we abort the transfer. For SSE encrypted files, we abort only if not using master key. Also fixed the check for when the path to a single file is used. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-7/+7
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat(files): Use receiving users language for the ownership transfer target ↵Ferdinand Thiessen2024-05-291-8/+13
| | | | | | folder Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-291-26/+2
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(files): Fix ownership transfer encrypted files detectionCôme Chilliet2024-04-301-1/+1
| | | | | | Discovered by psalm update Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(files): Also restore shares after ownership transfer for object storageFerdinand Thiessen2024-04-181-38/+73
| | | | | | | | | | When a file is moved between different storages then the file id is not (always) preserved. This means the file id has to be adjusted for all shares. So in case the file id does not exist anymore we try to find the new file id based on the target path of the transfer and the path suffix of the share. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* Merge pull request #39215 from shdehnavi/replace_substr_calls_in_files_appJohn Molakvoæ2024-02-231-2/+2
|\
| * Refactor "substr" calls to improve code readabilityHamid Dehnavi2023-09-271-2/+2
| | | | | | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* | chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-34/+34
|/ | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix: Always create user directory when transfering files to new usersJulius Härtl2023-04-061-0/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add SHARE_TYPE_SCIENCEMESHMichiel de Jong2023-03-081-1/+1
| | | | Signed-off-by: Michiel de Jong <michiel@unhosted.org>
* Merge pull request #30953 from ↵Vincent Petry2022-02-101-7/+6
|\ | | | | | | | | nextcloud/feat/init-storage-when-transferring-ownership Init user's file system if not existing on ownership transfer
| * Init user's file system if not existing on ownership transferCarl Schwan2022-02-011-7/+6
| | | | | | | | | | | | | | | | This makes it a bit easier to transfer ownership when the new user hasn't already logged in. This still doesn't support encrypted storages because the keys are not generated yet. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Fix path handling when transferring incoming sharesVincent Petry2022-02-101-1/+5
|/ | | | | | | | | When transferring incoming shares from a guest user without specifying a path, the $path is empty. The fix properly handles that situation to avoid looking for shares in a path with doubled slashes which failed to find shares to transfer. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Do not transfer shares for deleted usersVincent Petry2021-10-041-7/+20
| | | | | | | | | | Whenever a user was deleted but is still recipient of share entries, delete these entries upon transfer. Usually such entries would disappear after running cleanup background jobs. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Added support for transfering incoming file shares.Immanuel Pasanec2021-08-271-1/+140
| | | | | | | | | - new option --transfer-incoming-shares=1 | 0 - new config.php option 'transfer-incoming-shares' => true | false The command line option overrules the config.php option. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Log exception message during failed ownership transfer share restoreChristoph Wurst2021-08-241-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Only perform login check during ownership transfer for encryptionChristoph Wurst2021-03-191-2/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Introduce deck share type to ShareAPIControllerJulius Härtl2020-12-091-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #22648 from nextcloud/bugfix/noid/transfer-all-sharesJoas Schilling2020-09-091-2/+2
|\ | | | | Transfer shares if no path provided
| * Transfer shares if no path providedJulius Härtl2020-09-071-2/+2
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | 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>
* Transfer shares of the transferred root nodeJulius Härtl2020-08-311-3/+36
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #21797 from rawtaz/patch-1Morris Jobke2020-08-201-1/+1
|\ | | | | Include e-mail shares when transferring ownership
| * Include circle shares when transferring ownershiprawtaz2020-07-151-1/+1
| |
| * Include e-mail shares when transferring ownershiprawtaz2020-07-111-1/+1
| | | | | | E-mail shares weren't included in the processing of shares when using the `occ files:transfer-ownership` command, so they'd be lost (not visible in either the former or the new account). This commit fixes that.
* | Use constant instead of magic number Morris Jobke2020-08-111-1/+1
| | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Do not exit if available space cannot be determined on file transferJulius Härtl2020-08-111-1/+1
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update share type constant usageJoas Schilling2020-06-241-2/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-1/+0
| | | | | | | | | | | | | | | 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>