get(External\Manager::class); $manager->removeUserShares($params['uid']); } public static function unshareChildren($params) { $path = Filesystem::getView()->getAbsolutePath($params['path']); $view = new \OC\Files\View('/'); // find share mount points within $path and unmount them $mountManager = \OC\Files\Filesystem::getMountManager(); $mountedShares = $mountManager->findIn($path); foreach ($mountedShares as $mount) { if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) { $mountPoint = $mount->getMountPoint(); $view->unlink($mountPoint); } } } }