Browse Source

Do not list system users in contacts menu if sharing autocompletion is disabled

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
tags/v12.0.0beta2
Christoph Wurst 7 years ago
parent
commit
56a9084dd2
No account linked to committer's email address
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      apps/dav/appinfo/app.php

+ 8
- 2
apps/dav/appinfo/app.php View File

@@ -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());
});

Loading…
Cancel
Save