diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-13 17:40:57 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-13 17:40:57 +0200 |
commit | aa3eb6bb5be9979c31f402201241cf127573541e (patch) | |
tree | 3855741daa59adf89061aea68c75b749c54c91eb /lib/public/share.php | |
parent | 517efdf952526ce0f0a03107874baca18742c49b (diff) | |
download | nextcloud-server-aa3eb6bb5be9979c31f402201241cf127573541e.tar.gz nextcloud-server-aa3eb6bb5be9979c31f402201241cf127573541e.zip |
don't handle public share keys in lib/public/share.php but in apps/files_encryption/lib/util.php instead
Diffstat (limited to 'lib/public/share.php')
-rw-r--r-- | lib/public/share.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index b9cf05bbf7f..10400e34c50 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -138,6 +138,7 @@ class Share { $path_parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR)); $path = ''; $shares = array(); + $publicShare = false; $view = new \OC\Files\View('/' . $user . '/files/'); foreach ($path_parts as $p) { $path .= '/' . $p; @@ -184,27 +185,23 @@ class Share { $shares = array_merge($shares, $usersInGroup); } - $publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId'); - - if ($publicShareKeyId) { - //check for public link shares - $query = \OC_DB::prepare( - 'SELECT share_with + //check for public link shares + $query = \OC_DB::prepare( + 'SELECT share_with FROM `*PREFIX*share` WHERE item_source = ? AND share_type = ?' - ); + ); - $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); + $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); - if (\OC_DB::isError($result)) { - \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR); - } + if (\OC_DB::isError($result)) { + \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR); + } - if ($result->fetchRow()) { - $shares[] = $publicShareKeyId; - } + if ($result->fetchRow()) { + $publicShare = true; } } // Include owner in list of users, if requested @@ -212,7 +209,7 @@ class Share { $shares[] = $user; } - return array_unique($shares); + return array("users" => array_unique($shares), "public" => $publicShare); } /** |