[Pkg-owncloud-commits] [owncloud] 89/215: Allow getting *all* share entries owned by a user
David Prévot
taffit at moszumanska.debian.org
Tue May 5 01:01:27 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 518d5aadf51318886481696e4308fcc39684b508
Author: Robin Appelman <icewind at owncloud.com>
Date: Mon Mar 9 16:15:29 2015 +0100
Allow getting *all* share entries owned by a user
---
apps/files_sharing/tests/permissions.php | 4 +++-
lib/private/share/share.php | 12 ++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/apps/files_sharing/tests/permissions.php b/apps/files_sharing/tests/permissions.php
index 92703f4..91f0347 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 227a3d5..63bba06 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();
+ }
+
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list