Skip to content

Commit eeb9061

Browse files
committed
Stop transfer of ownership between same users
Stop the transfer of ownership between same user. Signed-off-by: Sujith Haridasan <[email protected]>
1 parent 9c21bd2 commit eeb9061

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/files/lib/Command/TransferOwnership.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ protected function configure() {
8787
}
8888

8989
protected function execute(InputInterface $input, OutputInterface $output): int {
90+
91+
/**
92+
* Check if source and destination users are same. If they are same then just ignore the transfer.
93+
*/
94+
95+
if ($input->getArgument(('source-user')) === $input->getArgument('destination-user')) {
96+
$output->writeln("<error>Kindly check the source and destination users, as they are same.</error>");
97+
return 1;
98+
}
99+
90100
$sourceUserObject = $this->userManager->get($input->getArgument('source-user'));
91101
$destinationUserObject = $this->userManager->get($input->getArgument('destination-user'));
92102

0 commit comments

Comments
 (0)