mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #4757 from nextcloud/fix/system-users-enumeration-contacts-menu
Do not list system users in contacts menu if sharing autocompletion i…
This commit is contained in:
commit
a06ef70c8f
1 changed files with 8 additions and 2 deletions
|
|
@ -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…
Reference in a new issue