Do not list system users in contacts menu if sharing autocompletion is disabled
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
684997f79c
commit
56a9084dd2
1 changed files with 8 additions and 2 deletions
|
@ -50,7 +50,13 @@ $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove',
|
||||||
$cm = \OC::$server->getContactsManager();
|
$cm = \OC::$server->getContactsManager();
|
||||||
$cm->register(function() use ($cm, $app) {
|
$cm->register(function() use ($cm, $app) {
|
||||||
$user = \OC::$server->getUserSession()->getUser();
|
$user = \OC::$server->getUserSession()->getUser();
|
||||||
if (!is_null($user)) {
|
if (is_null($user)) {
|
||||||
$app->setupContactsProvider($cm, $user->getUID());
|
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…
Reference in a new issue