Use search and limit parameters for share with search in sharing dropdown

remotes/origin/stable45
Michael Gapczynski 13 years ago
parent 2f1a990cad
commit d66f071d3e
  1. 4
      core/ajax/share.php

@ -67,11 +67,11 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['item']
case 'getShareWith': case 'getShareWith':
if (isset($_GET['search'])) { if (isset($_GET['search'])) {
$shareWith = array(); $shareWith = array();
$users = OC_User::getUsers(); $users = OC_User::getUsers($_GET['search'], 4);
foreach ($users as $user) { foreach ($users as $user) {
$shareWith[] = array('label' => $user, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $user)); $shareWith[] = array('label' => $user, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $user));
} }
$groups = OC_Group::getGroups(); $groups = OC_Group::getGroups($_GET['search'], 4);
foreach ($groups as $group) { foreach ($groups as $group) {
$shareWith[] = array('label' => $group.' (group)', 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group)); $shareWith[] = array('label' => $group.' (group)', 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group));
} }

Loading…
Cancel
Save