connection = $connection; $this->managerProvider = $managerProvider; $this->cloudIdManager = $cloudIdManager; } public function getMount(IUser $user, $data, IStorageFactory $storageFactory) { $managerProvider = $this->managerProvider; $manager = $managerProvider(); $data['manager'] = $manager; $mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/'); $data['mountpoint'] = $mountPoint; $data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']); $data['certificateManager'] = \OC::$server->getCertificateManager(); $data['HttpClientService'] = \OC::$server->getHTTPClientService(); return new Mount(self::STORAGE, $mountPoint, $data, $manager, $storageFactory); } public function getMountsForUser(IUser $user, IStorageFactory $loader) { $qb = $this->connection->getQueryBuilder(); $qb->select('remote', 'share_token', 'password', 'mountpoint', 'owner') ->from('share_external') ->where($qb->expr()->eq('user', $qb->createNamedParameter($user->getUID()))) ->andWhere($qb->expr()->eq('accepted', $qb->createNamedParameter(1, IQueryBuilder::PARAM_INT))); $result = $qb->executeQuery(); $mounts = []; while ($row = $result->fetch()) { $row['manager'] = $this; $row['token'] = $row['share_token']; $mounts[] = $this->getMount($user, $row, $loader); } $result->closeCursor(); return $mounts; } }