summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-17 18:00:37 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-17 18:00:37 -0400
commit4078e0a24249183e15a02e5955ea821e75775016 (patch)
tree709ec2a5faea256de3472aafd87171c7ebe9903e /apps/files_sharing
parent1303e40b6e151a3ff1ef55da89684daf9ad887ec (diff)
downloadnextcloud-server-4078e0a24249183e15a02e5955ea821e75775016.tar.gz
nextcloud-server-4078e0a24249183e15a02e5955ea821e75775016.zip
-1 is now a class constant (UNSHARED), for unsharing files from self
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib_share.php3
-rw-r--r--apps/files_sharing/sharedstorage.php2
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index 761a4da4394..c7ac7c3e8fd 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -30,6 +30,7 @@ class OC_Share {
const WRITE = 1;
const DELETE = 2;
+ const UNSHARED = -1;
const PUBLICLINK = "public";
private $token;
@@ -369,7 +370,7 @@ class OC_Share {
$query->execute(array(strlen($target), $target));
} else {
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET permissions = ? WHERE SUBSTR(target, 1, ?) = ? AND uid_shared_with ".self::getUsersAndGroups());
- $query->execute(array(-1, strlen($target), $target));
+ $query->execute(array(self::UNSHARED, strlen($target), $target));
}
}
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index fc7b7ddc9ce..9650770ab27 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -113,7 +113,7 @@ class OC_Filestorage_Shared extends OC_Filestorage {
// If the item is in the current directory and has a different name than the source, add it to the arrays
if (dirname($item['target']) == $path) {
// If the item was unshared from self, add it it to the arrays
- if ($item['permissions'] == -1) {
+ if ($item['permissions'] == OC_Share::UNSHARED) {
$sources[] = basename($item['source']);
$targets[] = "";
} else {