fix(settings): Fix sharing exclude groups from password requirement option not working

Signed-off-by: provokateurin <kate@provokateurin.de>
pull/47674/head
provokateurin 1 year ago
parent 6b85a3ae0e
commit c88ae37844
No known key found for this signature in database
  1. 4
      apps/settings/lib/Settings/Admin/Sharing.php
  2. 8
      apps/settings/src/components/AdminSettingsSharingForm.vue
  3. 8
      apps/settings/tests/Settings/Admin/SharingTest.php

@ -53,8 +53,8 @@ class Sharing implements IDelegatedSettings {
'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'),
'enforceLinksPassword' => Util::isPublicLinkPasswordRequired(false),
'passwordExcludedGroups' => json_decode($excludedPasswordGroups) ?? [],
'passwordExcludedGroupsFeatureEnabled' => $this->config->getSystemValueBool('sharing.allow_disabled_password_enforcement_groups', false),
'enforceLinksPasswordExcludedGroups' => json_decode($excludedPasswordGroups) ?? [],
'enforceLinksPasswordExcludedGroupsEnabled' => $this->config->getSystemValueBool('sharing.allow_disabled_password_enforcement_groups', false),
'onlyShareWithGroupMembers' => $this->shareManager->shareWithGroupMembersOnly(),
'onlyShareWithGroupMembersExcludeGroupList' => json_decode($onlyShareWithGroupMembersExcludeGroupList) ?? [],
'defaultExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_default_expire_date'),

@ -45,9 +45,9 @@
<NcCheckboxRadioSwitch :checked.sync="settings.enforceLinksPassword" :disabled="!settings.enableLinkPasswordByDefault">
{{ t('settings', 'Enforce password protection') }}
</NcCheckboxRadioSwitch>
<label v-if="settings.passwordExcludedGroupsFeatureEnabled" class="sharing__labeled-entry sharing__input">
<label v-if="settings.enforceLinksPasswordExcludedGroupsEnabled" class="sharing__labeled-entry sharing__input">
<span>{{ t('settings', 'Exclude groups from password requirements') }}</span>
<NcSettingsSelectGroup v-model="settings.passwordExcludedGroups"
<NcSettingsSelectGroup v-model="settings.enforceLinksPasswordExcludedGroups"
style="width: 100%"
:disabled="!settings.enforceLinksPassword || !settings.enableLinkPasswordByDefault" />
</label>
@ -222,8 +222,8 @@ interface IShareSettings {
restrictUserEnumerationFullMatchEmail: boolean
restrictUserEnumerationFullMatchIgnoreSecondDN: boolean
enforceLinksPassword: boolean
passwordExcludedGroups: string[]
passwordExcludedGroupsFeatureEnabled: boolean
enforceLinksPasswordExcludedGroups: string[]
enforceLinksPasswordExcludedGroupsEnabled: boolean
onlyShareWithGroupMembers: boolean
onlyShareWithGroupMembersExcludeGroupList: string[]
defaultExpireDate: boolean

@ -136,9 +136,9 @@ class SharingTest extends TestCase {
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
'onlyShareWithGroupMembersExcludeGroupList' => [],
'enforceLinksPasswordExcludedGroups' => [],
'enforceLinksPasswordExcludedGroupsEnabled' => false,
]
],
);
@ -229,9 +229,9 @@ class SharingTest extends TestCase {
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
'onlyShareWithGroupMembersExcludeGroupList' => [],
'enforceLinksPasswordExcludedGroups' => [],
'enforceLinksPasswordExcludedGroupsEnabled' => false,
]
],
);

Loading…
Cancel
Save