diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-05-12 14:54:59 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-05-22 12:44:34 +0200 |
commit | 2c1a1b1779bb229b47652e0a15c0885dbacc1e87 (patch) | |
tree | 314ad957cdf0550bcca84e4a80fd61928632261d /apps/settings/templates | |
parent | 6daf962b4cf3c480801f9042679951ba735154f4 (diff) | |
download | nextcloud-server-2c1a1b1779bb229b47652e0a15c0885dbacc1e87.tar.gz nextcloud-server-2c1a1b1779bb229b47652e0a15c0885dbacc1e87.zip |
Disable "Enforce password protection" if not asking for a password
"Enforce password protection" is a subcase of "Always ask for a
password", so it should be disabled if its parent option is unchecked.
Although other dependant options in the sharing settings are fully
hidden instead of just disabled this option is disabled but shown to
avoid confusion when updating from a previous Nextcloud version where
"Always ask for a password" was unchecked and "Enforce password
protection" was checked.
Besides that, due to their dependency the enforced password protection
is now automatically unchecked too if its parent option is unchecked.
Finally, the groups excluded from password requirements are also
disabled when "Always ask for a password" is unchecked, as they might be
still shown if "Enforce password protection" was checked due to an
update from a previous version.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/settings/templates')
-rw-r--r-- | apps/settings/templates/settings/admin/sharing.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/settings/templates/settings/admin/sharing.php b/apps/settings/templates/settings/admin/sharing.php index 1a943197a8a..2918a764d89 100644 --- a/apps/settings/templates/settings/admin/sharing.php +++ b/apps/settings/templates/settings/admin/sharing.php @@ -117,6 +117,8 @@ <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox" value="1" <?php if ($_['enforceLinkPassword']) { print_unescaped('checked="checked"'); +} ?> <?php if ($_['enableLinkPasswordByDefault'] !== 'yes') { + print_unescaped('disabled'); } ?> /> <label for="enforceLinkPassword" class="indent"><?php p($l->t('Enforce password protection'));?></label><br/> @@ -124,7 +126,9 @@ <span id="selectPasswordsExcludedGroups" class="double-indent <?php if (!$_['enforceLinkPassword']) { p('hidden'); } ?>"> <label for="shareapi_enforce_links_password_excluded_groups"><?php p($l->t('Exclude groups from password requirements:'));?></label><br/> <input name="shareapi_enforce_links_password_excluded_groups" id="passwordsExcludedGroups" value="<?php p($_['passwordExcludedGroups']) ?>" - style="width: 400px" class="noJSAutoUpdate double-indent"/> + style="width: 400px" class="noJSAutoUpdate double-indent" <?php if ($_['enableLinkPasswordByDefault'] !== 'yes') { + print_unescaped('disabled'); +} ?> /> </span><br/> <?php } ?> |