diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-13 15:29:53 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-20 16:32:56 +0100 |
commit | 483c6b68e2797a4608f5ff519ba961facdf8e9e4 (patch) | |
tree | d804635a0969b2431dfe4b1418bc8412ebab7880 /lib | |
parent | bc7bd0cd0532b8309d317c23ee4f13106e0a0e1d (diff) | |
download | nextcloud-server-483c6b68e2797a4608f5ff519ba961facdf8e9e4.tar.gz nextcloud-server-483c6b68e2797a4608f5ff519ba961facdf8e9e4.zip |
clear mount cache when removing applicables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/config/usermountcache.php | 17 | ||||
-rw-r--r-- | lib/public/files/config/iusermountcache.php | 19 |
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/private/files/config/usermountcache.php b/lib/private/files/config/usermountcache.php index e60c6d0400b..5fa192d1054 100644 --- a/lib/private/files/config/usermountcache.php +++ b/lib/private/files/config/usermountcache.php @@ -230,4 +230,21 @@ class UserMountCache implements IUserMountCache { ->where($builder->expr()->eq('user_id', $builder->createNamedParameter($user->getUID()))); $query->execute(); } + + public function removeUserStorageMount($storageId, $userId) { + $builder = $this->connection->getQueryBuilder(); + + $query = $builder->delete('mounts') + ->where($builder->expr()->eq('user_id', $builder->createNamedParameter($userId))) + ->andWhere($builder->expr()->eq('storage_id', $builder->createNamedParameter($storageId, \PDO::PARAM_INT))); + $query->execute(); + } + + public function remoteStorageMounts($storageId) { + $builder = $this->connection->getQueryBuilder(); + + $query = $builder->delete('mounts') + ->where($builder->expr()->eq('storage_id', $builder->createNamedParameter($storageId, \PDO::PARAM_INT))); + $query->execute(); + } } diff --git a/lib/public/files/config/iusermountcache.php b/lib/public/files/config/iusermountcache.php index 888e5d41e24..f722ad16310 100644 --- a/lib/public/files/config/iusermountcache.php +++ b/lib/public/files/config/iusermountcache.php @@ -67,4 +67,23 @@ interface IUserMountCache { * @since 9.0.0 */ public function removeUserMounts(IUser $user); + + /** + * Remove all mounts for a user and storage + * + * @param $storageId + * @param string $userId + * @return mixed + * @since 9.0.0 + */ + public function removeUserStorageMount($storageId, $userId); + + /** + * Remove all cached mounts for a storage + * + * @param $storageId + * @return mixed + * @since 9.0.0 + */ + public function remoteStorageMounts($storageId); } |