diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-08-21 22:22:35 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-08-21 22:22:35 +0200 |
commit | 97b536e3dfd35d1e51ecf866ccb433745c33309a (patch) | |
tree | ae39f9099f410e5bcd9dbd4c58b24faa2752a4c7 /settings/ajax | |
parent | 52d5429768acdb87b2dc2efedc89eb4ad0d29139 (diff) | |
download | nextcloud-server-97b536e3dfd35d1e51ecf866ccb433745c33309a.tar.gz nextcloud-server-97b536e3dfd35d1e51ecf866ccb433745c33309a.zip |
Add a trusted domain wizard
Adds a little button to the trusted domain warning, if an admin clicks on the warning he will be redirected to ownCloud and asked whether he want to trust this domain.
By far not the cleanest code, or clean at all, but does the job and I don't see a reason to make a lot of changes for this little improvement.
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/setsecurity.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/settings/ajax/setsecurity.php b/settings/ajax/setsecurity.php index 675d7eced47..3cb1d05ee63 100644 --- a/settings/ajax/setsecurity.php +++ b/settings/ajax/setsecurity.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2013, Lukas Reschke <lukas@statuscode.ch> + * Copyright (c) 2013-2014, Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ @@ -8,6 +8,14 @@ OC_Util::checkAdminUser(); OCP\JSON::callCheck(); -OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN)); +if(isset($_POST['enforceHTTPS'])) { + OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN)); +} + +if(isset($_POST['trustedDomain'])) { + $trustedDomains = OC_Config::getValue('trusted_domains'); + $trustedDomains[] = $_POST['trustedDomain']; + OC_Config::setValue('trusted_domains', $trustedDomains); +} echo 'true'; |