diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-11 20:37:50 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-11 20:37:50 +0100 |
commit | 4c1244f50c78b16c670f9ef1a8e33ef4b30d0d77 (patch) | |
tree | fd58111b3105e3f2bbc9a1efd186cbfe25a222b4 /settings/js | |
parent | 3ecb3f16bf51bf2b691292212e72081c6353a3d4 (diff) | |
parent | e73ccbd4cade0622615ee133496a571ac1d6dba7 (diff) | |
download | nextcloud-server-4c1244f50c78b16c670f9ef1a8e33ef4b30d0d77.tar.gz nextcloud-server-4c1244f50c78b16c670f9ef1a8e33ef4b30d0d77.zip |
Merge pull request #11917 from owncloud/fix-11909
Add checkbox to enforce SSL for subdomains
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/admin.js | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index e3a092f71b0..059e48ebabe 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -9,8 +9,8 @@ $(document).ready(function(){ if(answer) { $.ajax({ type: 'POST', - url: OC.generateUrl('settings/ajax/setsecurity.php'), - data: { trustedDomain: params.trustDomain } + url: OC.generateUrl('settings/admin/security/trustedDomains'), + data: { newTrustedDomain: params.trustDomain } }).done(function() { window.location.replace(OC.generateUrl('settings/admin')); }); @@ -73,10 +73,32 @@ $(document).ready(function(){ $('#setDefaultExpireDate').toggleClass('hidden', !(this.checked && $('#shareapiDefaultExpireDate')[0].checked)); }); - $('#security').change(function(){ - $.post(OC.filePath('settings','ajax','setsecurity.php'), { enforceHTTPS: $('#forcessl').val() },function(){} ); + $('#forcessl').change(function(){ + $(this).val(($(this).val() !== 'true')); + var forceSSLForSubdomain = $('#forceSSLforSubdomainsSpan'); + + $.post(OC.generateUrl('settings/admin/security/ssl'), { + enforceHTTPS: $(this).val() + },function(){} ); + + if($(this).val() === 'true') { + forceSSLForSubdomain.prop('disabled', false); + forceSSLForSubdomain.removeClass('hidden'); + } else { + forceSSLForSubdomain.prop('disabled', true); + forceSSLForSubdomain.addClass('hidden'); + } }); + $('#forceSSLforSubdomains').change(function(){ + $(this).val(($(this).val() !== 'true')); + + $.post(OC.generateUrl('settings/admin/security/ssl/subdomains'), { + forceSSLforSubdomains: $(this).val() + },function(){} ); + }); + + $('#mail_smtpauth').change(function() { if (!this.checked) { $('#mail_credentials').addClass('hidden'); |