diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-05-09 08:45:36 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-05-09 08:45:36 +0200 |
commit | 56a9084dd2f9a5726a74e1e789773558fade8b44 (patch) | |
tree | 8b363960e53d17f86da3ce2f72a25c5d142db94b /apps | |
parent | 684997f79c8d40cf41daafedbbcc6a1e0f17123b (diff) | |
download | nextcloud-server-56a9084dd2f9a5726a74e1e789773558fade8b44.tar.gz nextcloud-server-56a9084dd2f9a5726a74e1e789773558fade8b44.zip |
Do not list system users in contacts menu if sharing autocompletion is disabled
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/appinfo/app.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index 0d417fd3fed..963073c4413 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -50,7 +50,13 @@ $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', $cm = \OC::$server->getContactsManager(); $cm->register(function() use ($cm, $app) { $user = \OC::$server->getUserSession()->getUser(); - if (!is_null($user)) { - $app->setupContactsProvider($cm, $user->getUID()); + if (is_null($user)) { + return; } + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') !== 'yes') { + // Don't include system users + // This prevents user enumeration in the contacts menu and the mail app + return; + } + $app->setupContactsProvider($cm, $user->getUID()); }); |