]> source.dussan.org Git - nextcloud-server.git/commitdiff
Redirect user after clicking on link
authorLukas Reschke <lukas@owncloud.com>
Fri, 22 Aug 2014 14:01:03 +0000 (16:01 +0200)
committerLukas Reschke <lukas@owncloud.com>
Fri, 22 Aug 2014 14:01:03 +0000 (16:01 +0200)
Use DI

settings/ajax/setsecurity.php
settings/js/admin.js

index 3cb1d05ee63c0ff6e7c72d6177b1dd65b92a922a..f1f737a4943de06fba102c281ea74f247cc8781a 100644 (file)
@@ -9,13 +9,13 @@ OC_Util::checkAdminUser();
 OCP\JSON::callCheck();
 
 if(isset($_POST['enforceHTTPS'])) {
-       OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN));
+        \OC::$server->getConfig()->setSystemValue('forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN));
 }
 
 if(isset($_POST['trustedDomain'])) {
-       $trustedDomains = OC_Config::getValue('trusted_domains');
+       $trustedDomains = \OC::$server->getConfig()->getSystemValue('trusted_domains');
        $trustedDomains[] = $_POST['trustedDomain'];
-       OC_Config::setValue('trusted_domains', $trustedDomains);
+       \OC::$server->getConfig()->setSystemValue('trusted_domains', $trustedDomains);
 }
 
 echo 'true';
index b09704f87b7c6e679acd86988932989d5bea9503..56dc1b98716679def9db991d6d09b700845b28c7 100644 (file)
@@ -48,7 +48,9 @@ $(document).ready(function(){
                                        $.ajax({
                                                type: 'POST',
                                                url: OC.generateUrl('settings/ajax/setsecurity.php'),
-                                               data: { trustedDomain: params.trustDomain}
+                                               data: { trustedDomain: params.trustDomain }
+                                       }).done(function() {
+                                               window.location.replace(OC.generateUrl('settings/admin'));
                                        });
                                }
                        });