[Pkg-owncloud-commits] [owncloud] 47/79: Add option to disable autocomplete in share dialog
David Prévot
taffit at moszumanska.debian.org
Tue Sep 1 20:55:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 60cd11837111c19763852576ccab3fcbaf4c7473
Author: Morris Jobke <hey at morrisjobke.de>
Date: Mon Aug 17 10:16:56 2015 +0200
Add option to disable autocomplete in share dialog
---
core/ajax/share.php | 10 ++++++++++
settings/admin.php | 1 +
settings/templates/admin.php | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 69b8456..4546217 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',
diff --git a/settings/admin.php b/settings/admin.php
index 3021a8d..e597688 100644
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -122,6 +122,7 @@ $template->assign('allowPublicUpload', $appConfig->getValue('core', 'shareapi_al
$template->assign('allowResharing', $appConfig->getValue('core', 'shareapi_allow_resharing', 'yes'));
$template->assign('allowPublicMailNotification', $appConfig->getValue('core', 'shareapi_allow_public_notification', 'no'));
$template->assign('allowMailNotification', $appConfig->getValue('core', 'shareapi_allow_mail_notification', 'no'));
+$template->assign('allowShareDialogUserEnumeration', $appConfig->getValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'));
$template->assign('onlyShareWithGroupMembers', \OC\Share\Share::shareWithGroupMembersOnly());
$databaseOverload = (strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false);
$template->assign('databaseOverload', $databaseOverload);
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index a55071b..c9fe47b 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -245,6 +245,11 @@ if ($_['cronErrors']) {
<br />
<em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
</p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration"
+ <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br />
+ </p>
<?php print_unescaped($_['fileSharingSettings']); ?>
</div>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list