12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace OCA\Files_Sharing;
- use OC\Files\Filesystem;
- use OCP\EventDispatcher\IEventDispatcher;
- class Hooks {
- public static function deleteUser($params) {
- $manager = new External\Manager(
- \OC::$server->getDatabaseConnection(),
- \OC\Files\Filesystem::getMountManager(),
- \OC\Files\Filesystem::getLoader(),
- \OC::$server->getHTTPClientService(),
- \OC::$server->getNotificationManager(),
- \OC::$server->query(\OCP\OCS\IDiscoveryService::class),
- \OC::$server->getCloudFederationProviderManager(),
- \OC::$server->getCloudFederationFactory(),
- \OC::$server->getGroupManager(),
- \OC::$server->getUserManager(),
- $params['uid'],
- \OC::$server->query(IEventDispatcher::class)
- );
- $manager->removeUserShares($params['uid']);
- }
- public static function unshareChildren($params) {
- $path = Filesystem::getView()->getAbsolutePath($params['path']);
- $view = new \OC\Files\View('/');
-
- $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);
- }
- }
- }
- }
|