Browse Source
Merge pull request #23300 from sharidas/transfer-ownership-same-user
Stop transfer of ownership between same users
pull/23295/head
Morris Jobke
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
0 deletions
-
apps/files/lib/Command/TransferOwnership.php
|
|
|
@ -87,6 +87,16 @@ class TransferOwnership extends Command { |
|
|
|
} |
|
|
|
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int { |
|
|
|
|
|
|
|
/** |
|
|
|
* Check if source and destination users are same. If they are same then just ignore the transfer. |
|
|
|
*/ |
|
|
|
|
|
|
|
if ($input->getArgument(('source-user')) === $input->getArgument('destination-user')) { |
|
|
|
$output->writeln("<error>Ownership can't be transferred when Source and Destination users are the same user. Please check your input.</error>"); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
$sourceUserObject = $this->userManager->get($input->getArgument('source-user')); |
|
|
|
$destinationUserObject = $this->userManager->get($input->getArgument('destination-user')); |
|
|
|
|
|
|
|
|