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>
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>
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>
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>
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>
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>
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>
- 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>
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.
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>