summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-04-14 19:59:09 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-04-19 19:31:20 +0200
commit60680cb28cf0e0acf7002b3db3b5a727d92da0a2 (patch)
treee6fc46d93749e81fe37b1d25af3c0696e4ff8cc3
parentb818e24e2838ff38ed51bc18cac87e08bd3885f4 (diff)
downloadnextcloud-server-60680cb28cf0e0acf7002b3db3b5a727d92da0a2.tar.gz
nextcloud-server-60680cb28cf0e0acf7002b3db3b5a727d92da0a2.zip
Fix repeating user list in webUI
Steps: 1. create a folder A 2. share A with user1, user2 and user3 3. create a folder A/B 4. share A/B with user4 ("Shared in A with user1, user2, user3" appears in the sidebar below the share input field) 5. share A/B with user5 (the text is expanded with ", user1, user2, user3") After: user1, user2, user3 is only shown once
-rw-r--r--core/ajax/share.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index dadac4342b2..05e5b4ec302 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -274,13 +274,21 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
$reshare = false;
}
if ($_GET['checkShares'] == 'true') {
- $shares = OCP\Share::getItemShared(
+ $sharesTMP = OCP\Share::getItemShared(
(string)$_GET['itemType'],
(string)$_GET['itemSource'],
OCP\Share::FORMAT_NONE,
null,
true
);
+ $ids = [];
+ $shares = [];
+ foreach($sharesTMP as $share) {
+ if (!isset($ids[$share['id']])) {
+ $ids[$share['id']] = true;
+ $shares[] = $share;
+ }
+ }
} else {
$shares = false;
}