Commit Graph

28 Commits

Author SHA1 Message Date
Sujith Haridasan 08bdc549bb Stop transfer of ownership between same users
Stop the transfer of ownership between same user.

Signed-off-by: Sujith Haridasan <sujith.h@gmail.com>
2020-10-12 09:31:49 +05:30
Joas Schilling d7c0b9cced
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-26 15:12:11 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
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>
2020-04-10 14:19:56 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Tobia De Koninck 7c56144f49
Add option to transfer-ownership to move data
This will move the home folder of own user to another user. Only allowed
if that other user's home folder is empty.
Can be used as workaround to rename users.

Signed-off-by: Tobia De Koninck <LEDfan@users.noreply.github.com>
2020-02-03 11:15:56 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Christoph Wurst 07c5f3775c
Extract transfer ownership logic into a reusable service
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-11-26 08:50:19 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Roeland Jago Douma fc4c107788
Check quota before transfer ownership
Fixes #15664

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-13 11:22:19 +01:00
Daniel Calviño Sánchez 30d8e3ee05 Transfer room shares too with the "files:transfer-ownership" command
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
Daniel Calviño Sánchez b7474ed482
Fix transfering ownership of a share to user with same id as receiver
When the ownership of a user share is transfered to the receiver the
share is removed, as the receiver now owns the original file. However,
due to a missing condition, any share with a group, link or remote with
the same id as the user was removed, not only the user shares.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-24 15:05:42 +02:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Morris Jobke fbf3bfa3ea
improve file transfer code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-22 17:40:36 -06:00
Sujith H f654f29532
Providing --path option to transfer-ownership
This will help user to selectively move the folders
specified using --path option, instead of moving
entire folder under files directory.

Signed-off-by: Sujith H <sharidasan@owncloud.com>

Update the integration test for transfer-ownership

Update the integration test for transfer-ownership
as the new option --path is introduced in the command.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-20 18:29:21 -06:00
Morris Jobke 503a9160ae
Use a proper date format for transfer ownership
* on Windows : is not allowed as filename and doesn't get synced then
* uses 2017-03-02 22-00-00 instead of 2017-03-02T22:00:00+00:00 as format

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-02 22:36:18 -06:00
Morris Jobke e8511660f0 Merge pull request #2109 from nextcloud/oc_26533
Transfer ownership only analyze home storage
2016-11-18 15:32:28 +01:00
Roeland Jago Douma 7e6830729e
Test on storage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-15 09:53:43 +01:00
Morris Jobke e5b61527da Merge pull request #2125 from nextcloud/downstream-26546
Transfer ownership now returns exit code on error
2016-11-15 00:08:09 +01:00
Roeland Jago Douma 561a4fd989 Merge pull request #2115 from nextcloud/oc_26527
Skip broken shares when transferring ownership (#26527)
2016-11-14 17:07:59 +01:00
Vincent Petry 1355f2039e
Transfer ownership now returns exit code on error (#26546) 2016-11-14 16:57:18 +01:00
Vincent Petry 2b61b89391
Skip broken shares when transferring ownership (#26527) 2016-11-14 15:18:34 +01:00
Vincent Petry 3fe7186e31
First process group shares and then user shares
This prevents a validation failure where the code checks whether a file
is already shared with another user, but the check disables itself when
the owner is the same. Processing the groups first prevents the check
to kick in too early when the group share still has the old owner while
we try transferring the user share.
2016-11-14 14:39:17 +01:00
Vincent Petry f31b794add
Transfer ownership only analyze home storage
When transferring ownership, only the local files will be transferred
during the rename operation. This means that the analyzing code doesn't
need to recurse into any mount points.

Furthermore this fixes issues where FailedStorage might appear as mount
points as a result of inaccessible external storages or shares. So this
makes it more robust.
2016-11-14 14:34:30 +01:00
Vincent Petry f737426eca
Add using casing check/fix for initMountPoints 2016-11-02 22:21:46 +01:00
Joas Schilling 77a5491d9d
Make sure the UID is correctly cased
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-10-17 13:41:38 +02:00
Joas Schilling 813f0a0f40
Fix apps/ 2016-07-21 18:13:57 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Joas Schilling b34bacd071 Move Files app to PSR-4 (#24569)
* Move lib/ of Files app to PSR-4

* Move tests to PSR-4
2016-05-12 12:07:06 +02:00