summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/tests/permissions.php4
-rw-r--r--lib/private/share/share.php12
2 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/permissions.php b/apps/files_sharing/tests/permissions.php
index 92703f4a905..91f0347163a 100644
--- a/apps/files_sharing/tests/permissions.php
+++ b/apps/files_sharing/tests/permissions.php
@@ -103,7 +103,9 @@ class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
}
protected function tearDown() {
- $this->sharedCache->clear();
+ if ($this->sharedCache) {
+ $this->sharedCache->clear();
+ }
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 227a3d5a411..63bba06e67c 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2518,4 +2518,16 @@ class Share extends \OC\Share\Constants {
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
return ($enforcePassword === "yes") ? true : false;
}
+ /**
+ * Get all share entries, including non-unique group items
+ *
+ * @param string $owner
+ * @return array
+ */
+ public static function getAllSharesForOwner($owner) {
+ $query = 'SELECT * FROM `*PREFIX*share` WHERE `uid_owner` = ?';
+ $result = \OC::$server->getDatabaseConnection()->executeQuery($query, [$owner]);
+ return $result->fetchAll();
+ }
+
}