summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r--apps/files_sharing/ajax/share.php4
-rw-r--r--apps/files_sharing/ajax/userautocomplete.php15
2 files changed, 8 insertions, 11 deletions
diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php
index 0de899a0e1d..10a235e4323 100644
--- a/apps/files_sharing/ajax/share.php
+++ b/apps/files_sharing/ajax/share.php
@@ -8,9 +8,7 @@ $sources = explode(";", $_POST['sources']);
$uid_shared_with = $_POST['uid_shared_with'];
$permissions = $_POST['permissions'];
foreach ($sources as $source) {
- foreach ($uid_shared_with as $uid) {
- new OC_Share($source, $uid, $permissions);
- }
+ new OC_Share($source, $uid_shared_with, $permissions);
}
?> \ No newline at end of file
diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php
index 816e01ba9ee..c6519cc6b50 100644
--- a/apps/files_sharing/ajax/userautocomplete.php
+++ b/apps/files_sharing/ajax/userautocomplete.php
@@ -7,23 +7,22 @@ if (!OC_User::isLoggedIn()) {
echo json_encode(array("status" => "error", "data" => array("message" => "Authentication error")));
exit();
}
-$query = $_GET['term'];
-$length = strlen($query);
-$query = strtolower($query);
$users = array();
$ocusers = OC_User::getUsers();
$self = OC_User::getUser();
$groups = OC_GROUP::getUserGroups($self);
+$users[] = "<optgroup label='Users'>";
foreach ($ocusers as $user) {
- if ($user != $self && substr(strtolower($user), 0, $length) == $query) {
- $users[] = (object)array('id' => $user, 'label' => $user, 'name' => $user);
+ if ($user != $self) {
+ $users[] = "<option value='".$user."'>".$user."</option>";
}
}
+$users[] = "</optgroup>";
+$users[] = "<optgroup label='Groups'>";
foreach ($groups as $group) {
- if (substr(strtolower($group), 0, $length) == $query) {
- $users[] = (object)array('id' => $group, 'label' => $group, 'name' => $group);
- }
+ $users[] = "<option value='".$group."'>".$group."</option>";
}
+$users[] = "</optgroup>";
echo json_encode($users);
?>