aboutsummaryrefslogtreecommitdiffstats
path: root/settings/templates/admin.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-01-19 11:56:04 +0100
committerLukas Reschke <lukas@owncloud.com>2015-03-02 19:07:46 +0100
commitbbd5f2841561911461d992483cab54f5c18fa342 (patch)
tree113e9ab1919c8fb42a7fd90db79139b783a643c9 /settings/templates/admin.php
parent1155ad6e389e47e110a415f22eddda1570dc9ff2 (diff)
downloadnextcloud-server-bbd5f2841561911461d992483cab54f5c18fa342.tar.gz
nextcloud-server-bbd5f2841561911461d992483cab54f5c18fa342.zip
Let users configure security headers in their Webserver
Doing this in the PHP code is not the right approach for multiple reasons: 1. A bug in the PHP code prevents them from being added to the response. 2. They are only added when something is served via PHP and not in other cases (that makes for example the newest IE UXSS which is not yet patched by Microsoft exploitable on ownCloud) 3. Some headers such as the Strict-Transport-Security might require custom modifications by administrators. This was not possible before and lead to buggy situations. This pull request moves those headers out of the PHP code and adds a security check to the admin settings performed via JS.
Diffstat (limited to 'settings/templates/admin.php')
-rw-r--r--settings/templates/admin.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 1608aa8123b..b6326108bf6 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -66,20 +66,6 @@ if ($_['mail_smtpmode'] == 'qmail') {
<div id="security-warning">
<?php
-// is ssl working ?
-if (!$_['isConnectedViaHTTPS']) {
- ?>
-<div class="section">
- <h2><?php p($l->t('Security Warning'));?></h2>
-
- <span class="securitywarning">
- <?php p($l->t('You are accessing %s via HTTP. We strongly suggest you configure your server to require using HTTPS instead.', $theme->getTitle())); ?>
- </span>
-
-</div>
-<?php
-}
-
// is read only config enabled
if ($_['readOnlyConfigEnabled']) {
?>
@@ -370,51 +356,6 @@ if ($_['cronErrors']) {
</p>
</div>
-<div class="section" id="security">
- <h2><?php p($l->t('Security'));?></h2>
- <p>
- <input type="checkbox" name="forcessl" id="forcessl"
- <?php if ($_['enforceHTTPSEnabled']) {
- print_unescaped('checked="checked" ');
- print_unescaped('value="true"');
- } else {
- print_unescaped('value="false"');
- }
- ?>
- <?php if (!$_['isConnectedViaHTTPS']) p('disabled'); ?> />
- <label for="forcessl"><?php p($l->t('Enforce HTTPS'));?></label><br/>
- <em><?php p($l->t(
- 'Forces the clients to connect to %s via an encrypted connection.',
- $theme->getName()
- )); ?></em><br/>
- <span id="forceSSLforSubdomainsSpan" <?php if(!$_['enforceHTTPSEnabled']) { print_unescaped('class="hidden"'); } ?>>
- <input type="checkbox" name="forceSSLforSubdomains" id="forceSSLforSubdomains"
- <?php if ($_['forceSSLforSubdomainsEnabled']) {
- print_unescaped('checked="checked" ');
- print_unescaped('value="true"');
- } else {
- print_unescaped('value="false"');
- }
- ?>
- <?php if (!$_['isConnectedViaHTTPS']) { p('disabled'); } ?> />
- <label for="forceSSLforSubdomains"><?php p($l->t('Enforce HTTPS for subdomains'));?></label><br/>
- <em><?php p($l->t(
- 'Forces the clients to connect to %s and subdomains via an encrypted connection.',
- $theme->getName()
- )); ?></em>
- </span>
- <?php if (!$_['isConnectedViaHTTPS']) {
- print_unescaped("<br/><em>");
- p($l->t(
- 'Please connect to your %s via HTTPS to enable or disable the SSL enforcement.',
- $theme->getName()
- ));
- print_unescaped("</em>");
- }
- ?>
- </p>
-</div>
-
<div class="section">
<form id="mail_general_settings" class="mail_settings">
<h2><?php p($l->t('Email Server'));?></h2>