From 774aad3ab109aac99bf79246fa696d110c9a066f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 26 Sep 2025 11:28:25 +0200 Subject: [PATCH 1/4] feat(Share\IManager): add `matchUserId` method and update docs Add missing `matchUserId` method for full-match-autocomplete options and update docs to make it clearer what each options exactly means. Signed-off-by: Ferdinand Thiessen --- lib/private/Share20/Manager.php | 4 ++++ lib/public/Share/IManager.php | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index bd75701bc35c6..4abc3a3f54cad 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1931,6 +1931,10 @@ public function matchEmail(): bool { return $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_email', 'yes') === 'yes'; } + public function matchUserId(): bool { + return $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes') === 'yes'; + } + public function ignoreSecondDisplayName(): bool { return $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_dn', 'no') === 'yes'; } diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php index 35915ad9d9063..f65f7a4c56bfd 100644 --- a/lib/public/Share/IManager.php +++ b/lib/public/Share/IManager.php @@ -441,7 +441,8 @@ public function limitEnumerationToGroups(): bool; public function limitEnumerationToPhone(): bool; /** - * Check if user enumeration is allowed to return on full match + * Check if user enumeration is allowed to return also on full match + * and ignore limitations to phonebook or groups. * * @return bool * @since 21.0.1 @@ -449,7 +450,8 @@ public function limitEnumerationToPhone(): bool; public function allowEnumerationFullMatch(): bool; /** - * Check if the search should match the email + * When `allowEnumerationFullMatch` is enabled and `matchEmail` is set, + * then also return results for full email matches. * * @return bool * @since 25.0.0 @@ -457,7 +459,17 @@ public function allowEnumerationFullMatch(): bool; public function matchEmail(): bool; /** - * Check if the search should ignore the second in parentheses display name if there is any + * When `allowEnumerationFullMatch` is enabled and `matchUserId` is set, + * then also return results for full user id matches. + * + * @return bool + * @since 33.0.0 + */ + public function matchUserId(): bool; + + /** + * When `allowEnumerationFullMatch` is enabled and `ignoreSecondDisplayName` is set, + * then the search should ignore matches on the second displayname and only use the first. * * @return bool * @since 25.0.0 From aca305aeba07afecf6b048484591299bfb22fc8c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 26 Sep 2025 11:29:49 +0200 Subject: [PATCH 2/4] fix(settings): add missing sharing autocompletion configs to UI Signed-off-by: Ferdinand Thiessen --- apps/settings/lib/Settings/Admin/Sharing.php | 8 ++-- .../components/AdminSettingsSharingForm.vue | 37 ++++++++++++++----- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php index 0e59304f631c0..0564fb29d9b0c 100644 --- a/apps/settings/lib/Settings/Admin/Sharing.php +++ b/apps/settings/lib/Settings/Admin/Sharing.php @@ -53,10 +53,10 @@ public function getForm() { 'allowFederationOnPublicShares' => $this->appConfig->getValueBool('core', ConfigLexicon::SHAREAPI_ALLOW_FEDERATION_ON_PUBLIC_SHARES), 'restrictUserEnumerationToGroup' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_to_group'), 'restrictUserEnumerationToPhone' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_to_phone'), - 'restrictUserEnumerationFullMatch' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_full_match', true), - 'restrictUserEnumerationFullMatchUserId' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_full_match_userid', true), - 'restrictUserEnumerationFullMatchEmail' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_full_match_email', true), - 'restrictUserEnumerationFullMatchIgnoreSecondDN' => $this->getHumanBooleanConfig('core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_dn'), + 'restrictUserEnumerationFullMatch' => $this->shareManager->allowEnumerationFullMatch(), + 'restrictUserEnumerationFullMatchUserId' => $this->shareManager->matchUserId(), + 'restrictUserEnumerationFullMatchEmail' => $this->shareManager->matchEmail(), + 'restrictUserEnumerationFullMatchIgnoreSecondDN' => $this->shareManager->ignoreSecondDisplayName(), 'enforceLinksPassword' => Util::isPublicLinkPasswordRequired(false), 'enforceLinksPasswordExcludedGroups' => json_decode($excludedPasswordGroups) ?? [], 'enforceLinksPasswordExcludedGroupsEnabled' => $this->config->getSystemValueBool('sharing.allow_disabled_password_enforcement_groups', false), diff --git a/apps/settings/src/components/AdminSettingsSharingForm.vue b/apps/settings/src/components/AdminSettingsSharingForm.vue index b0e142d84802e..92727f6713f12 100644 --- a/apps/settings/src/components/AdminSettingsSharingForm.vue +++ b/apps/settings/src/components/AdminSettingsSharingForm.vue @@ -4,7 +4,7 @@ -->