]> source.dussan.org Git - nextcloud-server.git/commitdiff
-1 is now a class constant (UNSHARED), for unsharing files from self
authorMichael Gapczynski <GapczynskiM@gmail.com>
Wed, 17 Aug 2011 22:00:37 +0000 (18:00 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Wed, 17 Aug 2011 22:00:37 +0000 (18:00 -0400)
apps/files_sharing/lib_share.php
apps/files_sharing/sharedstorage.php

index 761a4da43942acad403f3deeb1bd95c9bd1f6a06..c7ac7c3e8fdf626f391294ec988341d733ccaa3c 100644 (file)
@@ -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));
                }
        }
 
index fc7b7ddc9ce94d5e9dd0a956fecebc37268a4228..9650770ab27b88d9a932969984828d9ac2990904 100644 (file)
@@ -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 {