/** * @param string $path */ public function setMountPoint($path) { $this->superShare->setTarget($path); foreach ($this->groupedShares as $share) { $share->setTarget($path); } }
/** * Resolve a group share to a user specific share * Thus if the user moved their group share make sure this is properly reflected here. * * @param \OCP\Share\IShare $share * @param string $userId * @return Share Returns the updated share if one was found else return the original share. */ private function resolveGroupShare(\OCP\Share\IShare $share, $userId) { $qb = $this->dbConn->getQueryBuilder(); $stmt = $qb->select('*')->from('share')->where($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())))->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_USERGROUP)))->andWhere($qb->expr()->eq('share_with', $qb->createNamedParameter($userId)))->setMaxResults(1)->execute(); $data = $stmt->fetch(); $stmt->closeCursor(); if ($data !== false) { $share->setPermissions((int) $data['permissions']); $share->setTarget($data['file_target']); } return $share; }
/** * update fileTarget in the database if the mount point changed * * @param string $newPath * @param \OCP\Share\IShare $share * @return bool */ private function updateFileTarget($newPath, &$share) { $share->setTarget($newPath); \OC::$server->getShareManager()->moveShare($share, $this->user); }
/** * @param string $path */ public function setMountPoint($path) { $this->newShare->setTarget($path); }