diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-08 16:18:15 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-09 15:41:06 +0100 |
commit | 10b9bf15f4a428b7455755f1fd2c684b47c3f75c (patch) | |
tree | 86c9d98548e86b4f49283c654e83ed7ae5fba6b8 | |
parent | cbb7934fb3ad69e84bf8b1bbe310ee2700e778a3 (diff) | |
download | nextcloud-server-10b9bf15f4a428b7455755f1fd2c684b47c3f75c.tar.gz nextcloud-server-10b9bf15f4a428b7455755f1fd2c684b47c3f75c.zip |
Set share owner and share initiator on upate as well
-rw-r--r-- | apps/federatedfilesharing/lib/federatedshareprovider.php | 2 | ||||
-rw-r--r-- | apps/files/appinfo/register_command.php | 3 | ||||
-rw-r--r-- | apps/files/command/transferownership.php | 8 |
3 files changed, 4 insertions, 9 deletions
diff --git a/apps/federatedfilesharing/lib/federatedshareprovider.php b/apps/federatedfilesharing/lib/federatedshareprovider.php index 0825a0e69bc..0e6089bde07 100644 --- a/apps/federatedfilesharing/lib/federatedshareprovider.php +++ b/apps/federatedfilesharing/lib/federatedshareprovider.php @@ -220,6 +220,8 @@ class FederatedShareProvider implements IShareProvider { $qb->update('share') ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))) ->set('permissions', $qb->createNamedParameter($share->getPermissions())) + ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner())) + ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy())) ->execute(); return $share; diff --git a/apps/files/appinfo/register_command.php b/apps/files/appinfo/register_command.php index f170367f10c..0ec2fe1a584 100644 --- a/apps/files/appinfo/register_command.php +++ b/apps/files/appinfo/register_command.php @@ -24,9 +24,8 @@ $dbConnection = \OC::$server->getDatabaseConnection(); $userManager = OC::$server->getUserManager(); $shareManager = \OC::$server->getShareManager(); -$rootFolder = \OC::$server->getRootFolder(); /** @var Symfony\Component\Console\Application $application */ $application->add(new OCA\Files\Command\Scan($userManager)); $application->add(new OCA\Files\Command\DeleteOrphanedFiles($dbConnection)); -$application->add(new OCA\Files\Command\TransferOwnership($userManager, $shareManager, $rootFolder)); +$application->add(new OCA\Files\Command\TransferOwnership($userManager, $shareManager)); diff --git a/apps/files/command/transferownership.php b/apps/files/command/transferownership.php index 22fd2db2196..a8d1f4e0346 100644 --- a/apps/files/command/transferownership.php +++ b/apps/files/command/transferownership.php @@ -25,7 +25,6 @@ use OC\Files\Filesystem; use OC\Files\View; use OCP\Files\FileInfo; use OCP\Files\Folder; -use OCP\Files\IRootFolder; use OCP\IUserManager; use OCP\Share\IManager; use OCP\Share\IShare; @@ -61,13 +60,9 @@ class TransferOwnership extends Command { /** @var string */ private $finalTarget; - /** @var IRootFolder */ - private $rootFolder; - - public function __construct(IUserManager $userManager, IManager $shareManager, IRootFolder $rootFolder) { + public function __construct(IUserManager $userManager, IManager $shareManager) { $this->userManager = $userManager; $this->shareManager = $shareManager; - $this->rootFolder = $rootFolder; parent::__construct(); } @@ -208,7 +203,6 @@ class TransferOwnership extends Command { private function restoreShares(OutputInterface $output) { $output->writeln("Restoring shares ..."); $progress = new ProgressBar($output, count($this->shares)); - /** @var Folder $sourceRoot */ foreach($this->shares as $share) { if ($share->getSharedWith() === $this->destinationUser) { |