summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-08-30 18:11:18 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-08-30 18:11:18 +0200
commit8ef40277b21688112c48d40a9c80a519c3e7460c (patch)
treee1dce17e21c734964aec2ae432d03677d7f32d57 /core/ajax
parent40cee5639e89ad052ba5234a28e5f197f2fd70ba (diff)
parent0f5df181a3b1f88075193fca0bed88f289314c8e (diff)
downloadnextcloud-server-8ef40277b21688112c48d40a9c80a519c3e7460c.tar.gz
nextcloud-server-8ef40277b21688112c48d40a9c80a519c3e7460c.zip
Merge master into oc_preview
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/share.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index d3c6a8456a6..648f0a71bd4 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -181,10 +181,10 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
// }
// }
// }
+ $groups = OC_Group::getGroups($_GET['search']);
if ($sharePolicy == 'groups_only') {
- $groups = OC_Group::getUserGroups(OC_User::getUser());
- } else {
- $groups = OC_Group::getGroups();
+ $usergroups = OC_Group::getUserGroups(OC_User::getUser());
+ $groups = array_intersect($groups, $usergroups);
}
$count = 0;
$users = array();
@@ -219,11 +219,10 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
foreach ($groups as $group) {
if ($count < 15) {
- if (stripos($group, $_GET['search']) !== false
- && (!isset($_GET['itemShares'])
+ if (!isset($_GET['itemShares'])
|| !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])
|| !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])
- || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) {
+ || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) {
$shareWith[] = array(
'label' => $group.' ('.$l->t('group').')',
'value' => array(