summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-08-17 10:16:56 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-23 15:06:28 +0200
commit6636605ea6d2fb44a8534f570b8555dc4aac3400 (patch)
tree75691badf0bbd2a77903dde0440dc5864282494e /core/ajax
parentd54d9a573fac498c4aaeea0df832a204cf525b58 (diff)
downloadnextcloud-server-6636605ea6d2fb44a8534f570b8555dc4aac3400.tar.gz
nextcloud-server-6636605ea6d2fb44a8534f570b8555dc4aac3400.zip
Add option to disable autocomplete in share dialog
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/share.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 69b84564ab1..4546217def3 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -379,6 +379,16 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
}
}
+ $sharingAutocompletion = \OC::$server->getConfig()
+ ->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes');
+
+ if ($sharingAutocompletion !== 'yes') {
+ $searchTerm = strtolower($_GET['search']);
+ $shareWith = array_filter($shareWith, function($user) use ($searchTerm) {
+ return strtolower($user['label']) === $searchTerm
+ || strtolower($user['value']['shareWith']) === $searchTerm;
+ });
+ }
$sorter = new \OC\Share\SearchResultSorter((string)$_GET['search'],
'label',