Esempio n. 1
0
 /**
  * unmount file from yourself
  */
 public static function postUnmount($params)
 {
     $path = $params[\OC\Files\Filesystem::signal_param_path];
     $user = \OCP\User::getUser();
     if (!isset(self::$unmountedFiles[$path])) {
         return true;
     }
     $umountedFile = self::$unmountedFiles[$path];
     $keyPath = $umountedFile['keyPath'];
     $owner = $umountedFile['owner'];
     $ownerPath = $umountedFile['ownerPath'];
     $view = new \OC\Files\View();
     // we don't need to remember the file any longer
     unset(self::$unmountedFiles[$path]);
     // check if the user still has access to the file, otherwise delete share key
     $sharingUsers = \OCP\Share::getUsersSharingFile($path, $user);
     if (!in_array($user, $sharingUsers['users'])) {
         Keymanager::delShareKey($view, array($user), $keyPath, $owner, $ownerPath);
     }
 }