Allow getting *all* share entries owned by a user

This commit is contained in:
Robin Appelman 2015-03-09 16:15:29 +01:00
parent 849e5521de
commit 518d5aadf5
2 changed files with 15 additions and 1 deletions

View File

@ -103,7 +103,9 @@ class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
} }
protected function tearDown() { protected function tearDown() {
if ($this->sharedCache) {
$this->sharedCache->clear(); $this->sharedCache->clear();
}
self::loginHelper(self::TEST_FILES_SHARING_API_USER1); self::loginHelper(self::TEST_FILES_SHARING_API_USER1);

View File

@ -2518,4 +2518,16 @@ class Share extends \OC\Share\Constants {
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no'); $enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
return ($enforcePassword === "yes") ? true : false; 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();
}
} }