summaryrefslogtreecommitdiffstats
path: root/settings/js/admin.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-03 10:55:52 +0100
committerLukas Reschke <lukas@owncloud.com>2014-11-03 16:53:03 +0100
commite73ccbd4cade0622615ee133496a571ac1d6dba7 (patch)
tree114c981b1ae7ae1e050dbfe74c1333b238a2b178 /settings/js/admin.js
parentf8f38b06dfef0af2555124cf0d1ec55402aa8c8c (diff)
downloadnextcloud-server-e73ccbd4cade0622615ee133496a571ac1d6dba7.tar.gz
nextcloud-server-e73ccbd4cade0622615ee133496a571ac1d6dba7.zip
Migrate "setsecurity.php" to the AppFramework
Add switch to enforce SSL for subdomains Add unit tests Add test for boolean values Camel-case Fix ugly JS
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r--settings/js/admin.js30
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');