diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-02 14:41:46 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-02 14:41:46 +0200 |
commit | b918c06be60eea9edde26b05621898627c71130d (patch) | |
tree | f16cbad18677ee2f3262474f5668603adf52896e /core/ajax/share.php | |
parent | 4bbefdf608fdf930fa6fd1f783d6f58267752394 (diff) | |
parent | 06870a6e390f68d741893b4454b8fe4063404ca8 (diff) | |
download | nextcloud-server-b918c06be60eea9edde26b05621898627c71130d.tar.gz nextcloud-server-b918c06be60eea9edde26b05621898627c71130d.zip |
Merge branch 'master' into sharing_mail_notification_master
Conflicts:
lib/util.php
Diffstat (limited to 'core/ajax/share.php')
-rw-r--r-- | core/ajax/share.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php index 8b5191e6550..1e954ac4f9d 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -265,10 +265,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(); @@ -303,11 +303,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( |