Skip to content

Commit 372c8dc

Browse files
author
Matthias Beaupère
committed
Set default expire date for share links to 7
Signed-off-by: Matthias Beaupère <[email protected]>
1 parent 10f62eb commit 372c8dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/settings/js/admin.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,24 @@ $(document).ready(function(){
7979
value = 'no';
8080
}
8181
}
82+
if ((this.id === 'shareapiExpireAfterNDays' || this.id === 'shareapiInternalExpireAfterNDays') && value === '') {
83+
value = '7'
84+
}
8285
OCP.AppConfig.setValue('core', $(this).attr('name'), value);
8386
});
8487

8588
$('#shareapiDefaultExpireDate').change(function() {
8689
$("#setDefaultExpireDate").toggleClass('hidden', !this.checked);
90+
if (this.checked) {
91+
$('#shareapiExpireAfterNDays').trigger('change');
92+
}
8793
});
8894

8995
$('#shareapiDefaultInternalExpireDate').change(function() {
9096
$("#setDefaultInternalExpireDate").toggleClass('hidden', !this.checked);
97+
if (this.checked) {
98+
$('#shareapiInternalExpireAfterNDays').trigger('change');
99+
}
91100
});
92101

93102
$('#publicShareDisclaimer').change(function() {

0 commit comments

Comments
 (0)