summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-16 15:57:01 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-16 15:57:01 +0200
commit0616eb4007b14d701ca3949c83bddf0a31507b56 (patch)
tree1fac0dfd86d46afdf116f45bd2cf331c25afa177 /apps/files_sharing/lib
parent5b1b6572f7ae9ac9e300032e049e317ac7496a30 (diff)
downloadnextcloud-server-0616eb4007b14d701ca3949c83bddf0a31507b56.tar.gz
nextcloud-server-0616eb4007b14d701ca3949c83bddf0a31507b56.zip
Fix multiple users having the same external share mountpoint
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/external/manager.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php
index 381651f8c6a..70a0e98ebd5 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -117,22 +117,24 @@ class Manager {
* @return bool
*/
public function setMountPoint($source, $target) {
+ $user = $this->userSession->getUser();
$source = $this->stripPath($source);
$target = $this->stripPath($target);
$sourceHash = md5($source);
$targetHash = md5($target);
$query = $this->connection->prepare('UPDATE *PREFIX*share_external SET
- `mountpoint` = ?, `mountpoint_hash` = ? WHERE `mountpoint_hash` = ?');
- $result = (bool)$query->execute(array($target, $targetHash, $sourceHash));
+ `mountpoint` = ?, `mountpoint_hash` = ? WHERE `mountpoint_hash` = ? AND `user` = ?');
+ $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $user->getUID()));
return $result;
}
public function removeShare($mountPoint) {
+ $user = $this->userSession->getUser();
$mountPoint = $this->stripPath($mountPoint);
$hash = md5($mountPoint);
- $query = $this->connection->prepare('DELETE FROM *PREFIX*share_external WHERE `mountpoint_hash` = ?');
- return (bool)$query->execute(array($hash));
+ $query = $this->connection->prepare('DELETE FROM *PREFIX*share_external WHERE `mountpoint_hash` = ? AND `user` = ?');
+ return (bool)$query->execute(array($hash, $user->getUID()));
}
}