Skip to content
Snippets Groups Projects
Commit 4078e0a2 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

-1 is now a class constant (UNSHARED), for unsharing files from self

parent 1303e40b
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ class OC_Share { ...@@ -30,6 +30,7 @@ class OC_Share {
const WRITE = 1; const WRITE = 1;
const DELETE = 2; const DELETE = 2;
const UNSHARED = -1;
const PUBLICLINK = "public"; const PUBLICLINK = "public";
private $token; private $token;
...@@ -369,7 +370,7 @@ class OC_Share { ...@@ -369,7 +370,7 @@ class OC_Share {
$query->execute(array(strlen($target), $target)); $query->execute(array(strlen($target), $target));
} else { } else {
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET permissions = ? WHERE SUBSTR(target, 1, ?) = ? AND uid_shared_with ".self::getUsersAndGroups()); $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));
} }
} }
......
...@@ -113,7 +113,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { ...@@ -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 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 (dirname($item['target']) == $path) {
// If the item was unshared from self, add it it to the arrays // 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']); $sources[] = basename($item['source']);
$targets[] = ""; $targets[] = "";
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment