summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/api/server2server.php2
-rw-r--r--apps/files_sharing/tests/server2server.php32
-rw-r--r--lib/private/util.php8
3 files changed, 41 insertions, 1 deletions
diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php
index 6da95ed6549..a3d58880f70 100644
--- a/apps/files_sharing/api/server2server.php
+++ b/apps/files_sharing/api/server2server.php
@@ -178,7 +178,7 @@ class Server2Server {
if ($share) {
// userId must be set to the user who unshares
- \OCP\Share::unshare($share['item_type'], $share['item_source'], $share['share_type'], null, $share['uid_owner']);
+ \OCP\Share::unshare($share['item_type'], $share['item_source'], $share['share_type'], $share['share_with'], $share['uid_owner']);
list($file, $link) = $this->getFile($share['uid_owner'], $share['file_source']);
diff --git a/apps/files_sharing/tests/server2server.php b/apps/files_sharing/tests/server2server.php
index 298f1008f71..7714f274c6d 100644
--- a/apps/files_sharing/tests/server2server.php
+++ b/apps/files_sharing/tests/server2server.php
@@ -147,6 +147,38 @@ class Test_Files_Sharing_S2S_OCS_API extends TestCase {
$this->assertEmpty($data);
}
+ function testDeclineShareMultiple() {
+ $dummy = \OCP\DB::prepare('
+ INSERT INTO `*PREFIX*share`
+ (`share_type`, `uid_owner`, `item_type`, `item_source`, `item_target`, `file_source`, `file_target`, `permissions`, `stime`, `token`, `share_with`)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+ ');
+ $dummy->execute(array(\OCP\Share::SHARE_TYPE_REMOTE, self::TEST_FILES_SHARING_API_USER1, 'test', '1', '/1', '1', '/test.txt', '1', time(), 'token1', 'foo@bar'));
+ $dummy->execute(array(\OCP\Share::SHARE_TYPE_REMOTE, self::TEST_FILES_SHARING_API_USER1, 'test', '1', '/1', '1', '/test.txt', '1', time(), 'token2', 'bar@bar'));
+
+ $verify = \OCP\DB::prepare('SELECT * FROM `*PREFIX*share`');
+ $result = $verify->execute();
+ $data = $result->fetchAll();
+ $this->assertCount(2, $data);
+
+ $_POST['token'] = 'token1';
+ $this->s2s->declineShare(array('id' => $data[0]['id']));
+
+ $verify = \OCP\DB::prepare('SELECT * FROM `*PREFIX*share`');
+ $result = $verify->execute();
+ $data = $result->fetchAll();
+ $this->assertCount(1, $data);
+ $this->assertEquals('bar@bar', $data[0]['share_with']);
+
+ $_POST['token'] = 'token2';
+ $this->s2s->declineShare(array('id' => $data[0]['id']));
+
+ $verify = \OCP\DB::prepare('SELECT * FROM `*PREFIX*share`');
+ $result = $verify->execute();
+ $data = $result->fetchAll();
+ $this->assertEmpty($data);
+ }
+
/**
* @dataProvider dataTestDeleteUser
*/
diff --git a/lib/private/util.php b/lib/private/util.php
index 6f53be8446a..88d78ad83c6 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -828,6 +828,14 @@ class OC_Util {
);
}
+ if(function_exists('xml_parser_create') &&
+ version_compare('2.7.0', LIBXML_DOTTED_VERSION) === 1) {
+ $errors[] = array(
+ 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [LIBXML_DOTTED_VERSION]),
+ 'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
+ );
+ }
+
if (!self::isAnnotationsWorking()) {
$errors[] = array(
'error' => $l->t('PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible.'),