mirror of
https://github.com/nextcloud/server.git
synced 2025-10-26 19:21:34 +00:00
Merge pull request #38227 from nextcloud/allow-enforcing-share-passwords-only-when-already-asking-for-a-password
Allow enforcing share passwords only when already asking for a password
This commit is contained in:
commit
fdf7fd45be
@ -46,6 +46,21 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||
$('#setDefaultRemoteExpireDate').toggleClass('hidden', !this.checked)
|
||||
})
|
||||
|
||||
$('#enableLinkPasswordByDefault').change(function() {
|
||||
if (this.checked) {
|
||||
$('#enforceLinkPassword').removeAttr('disabled')
|
||||
$('#passwordsExcludedGroups').removeAttr('disabled')
|
||||
} else {
|
||||
$('#enforceLinkPassword').attr('disabled', '')
|
||||
$('#passwordsExcludedGroups').attr('disabled', '')
|
||||
|
||||
// Uncheck "Enforce password protection" when "Always asks for a
|
||||
// password" is unchecked; the change event needs to be explicitly
|
||||
// triggered so it behaves like a change done by the user.
|
||||
$('#enforceLinkPassword').removeAttr('checked').trigger('change')
|
||||
}
|
||||
})
|
||||
|
||||
$('#enforceLinkPassword').change(function() {
|
||||
$('#selectPasswordsExcludedGroups').toggleClass('hidden', !this.checked)
|
||||
})
|
||||
|
||||
@ -117,17 +117,19 @@
|
||||
<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"><?php p($l->t('Enforce password protection'));?></label><br/>
|
||||
<label for="enforceLinkPassword" class="indent"><?php p($l->t('Enforce password protection'));?></label><br/>
|
||||
|
||||
<?php if ($_['passwordExcludedGroupsFeatureEnabled']) { ?>
|
||||
<div id="selectPasswordsExcludedGroups" class="indent <?php if (!$_['enforceLinkPassword']) { p('hidden'); } ?>">
|
||||
<div class="indent">
|
||||
<label for="shareapi_enforce_links_password_excluded_groups"><?php p($l->t('Exclude groups from password requirements:'));?>
|
||||
<br />
|
||||
<input name="shareapi_enforce_links_password_excluded_groups" id="passwordsExcludedGroups" value="<?php p($_['passwordExcludedGroups']) ?>" style="width: 400px" class="noJSAutoUpdate"/>
|
||||
</div>
|
||||
</div>
|
||||
<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" <?php if ($_['enableLinkPasswordByDefault'] !== 'yes') {
|
||||
print_unescaped('disabled');
|
||||
} ?> />
|
||||
</span><br/>
|
||||
<?php } ?>
|
||||
|
||||
<input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox"
|
||||
|
||||
4
dist/settings-legacy-admin.js
vendored
4
dist/settings-legacy-admin.js
vendored
File diff suppressed because one or more lines are too long
2
dist/settings-legacy-admin.js.map
vendored
2
dist/settings-legacy-admin.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user