diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-01-11 14:18:51 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-01-11 14:18:51 +0100 |
commit | 466cdab680d74cad2cbb902efa3e3c2f9e35f767 (patch) | |
tree | 3d1b553668b16a57c68721ee325ee734df886906 /settings/ajax | |
parent | 60489764f37a6f344fa20e361a26c7a6006f9c97 (diff) | |
download | nextcloud-server-466cdab680d74cad2cbb902efa3e3c2f9e35f767.tar.gz nextcloud-server-466cdab680d74cad2cbb902efa3e3c2f9e35f767.zip |
Add security section to admin menu
Currently it only allows the admin to enable or disable the HTTPS
enforcement, but in the future it could be expanded to further options.
The HTTPS enforcement only allows the admin to enforce it, if he is
connected via HTTPS. (To prevent admins to enable it without a proper
SSL setup)
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/setsecurity.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/settings/ajax/setsecurity.php b/settings/ajax/setsecurity.php new file mode 100644 index 00000000000..16a85aade81 --- /dev/null +++ b/settings/ajax/setsecurity.php @@ -0,0 +1,13 @@ +<?php +/** + * Copyright (c) 2013, Lukas Reschke <lukas@statuscode.ch> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +OC_Util::checkAdminUser(); +OCP\JSON::callCheck(); + +OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN)); + +echo 'true';
\ No newline at end of file |