Skip to content

Commit

Permalink
fix(settings): Fix sharing exclude groups from password requirement o…
Browse files Browse the repository at this point in the history
…ption not working

Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Sep 3, 2024
1 parent 2f285ae commit 3bca1ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/settings/lib/Settings/Admin/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function getForm() {
'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(),
'defaultExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_default_expire_date'),
'expireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'),
Expand Down
8 changes: 4 additions & 4 deletions apps/settings/src/components/AdminSettingsSharingForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,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>
Expand Down Expand Up @@ -214,8 +214,8 @@ interface IShareSettings {
restrictUserEnumerationFullMatchEmail: boolean
restrictUserEnumerationFullMatchIgnoreSecondDN: boolean
enforceLinksPassword: boolean
passwordExcludedGroups: string[]
passwordExcludedGroupsFeatureEnabled: boolean
enforceLinksPasswordExcludedGroups: string[]
enforceLinksPasswordExcludedGroupsEnabled: boolean
onlyShareWithGroupMembers: boolean
defaultExpireDate: boolean
expireAfterNDays: string
Expand Down
8 changes: 4 additions & 4 deletions apps/settings/tests/Settings/Admin/SharingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ public function testGetFormWithoutExcludedGroups(): void {
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
'enforceLinksPasswordExcludedGroups' => [],
'enforceLinksPasswordExcludedGroupsEnabled' => false,
]
],
);
Expand Down Expand Up @@ -252,8 +252,8 @@ public function testGetFormWithExcludedGroups(): void {
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
'enforceLinksPasswordExcludedGroups' => [],
'enforceLinksPasswordExcludedGroupsEnabled' => false,
]
],
);
Expand Down

0 comments on commit 3bca1ef

Please sign in to comment.