Skip to content

Commit

Permalink
Refs #4990 remove Protocol section from system check
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed May 4, 2014
1 parent abe158d commit cef8bd5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 30 deletions.
4 changes: 0 additions & 4 deletions core/ProxyHeaders.php
Expand Up @@ -22,10 +22,6 @@ class ProxyHeaders
*/
public static function getProtocolInformation()
{
if (Common::getRequestVar('clientProtocol', 'http', 'string') == 'https') {
return 'https';
}

if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
return 'SERVER_PORT=443';
}
Expand Down
2 changes: 0 additions & 2 deletions lang/en.json
Expand Up @@ -1135,8 +1135,6 @@
"SystemCheckPdoAndMysqliHelp": "On a Linux server you can compile php with the following options: %1$s In your php.ini, add the following lines: %2$s",
"SystemCheckPhp": "PHP version",
"SystemCheckPhpPdoAndMysqli": "More information on: %1$sPHP PDO%2$s and %3$sMYSQLI%4$s.",
"SystemCheckSecureProtocol": "Secure protocol",
"SystemCheckSecureProtocolHelp": "It appears you're using https with your web server. These lines will be added to config\/config.ini.php:",
"SystemCheckSplHelp": "You need to configure and rebuild PHP with the Standard PHP Library (SPL) enabled (by default).",
"SystemCheckSummaryNoProblems": "Huzzah! There are no problems with your Piwik setup. Give yourself a pat on the back.",
"SystemCheckSummaryThereWereErrors": "Uh-oh! Piwik has detected some %1$scritical issues%2$s with your Piwik setup. %3$sThese issues should be fixed immediately.%4$s",
Expand Down
14 changes: 13 additions & 1 deletion plugins/Installation/Controller.php
Expand Up @@ -476,15 +476,27 @@ private function createConfigFile($dbInfos)
if (count($headers = ProxyHeaders::getProxyHostHeaders()) > 0) {
$config->General['proxy_host_headers'] = $headers;
}

if (Common::getRequestVar('clientProtocol', 'http', 'string') == 'https') {
$protocol = 'https';
} else {
$protocol = ProxyHeaders::getProtocolInformation();
}

if (!empty($protocol)
&& !\Piwik\ProxyHttp::isHttps()) {
$config->General['assume_secure_protocol'] = '1';
}

$config->General['salt'] = Common::generateUniqId();
$config->General['installation_in_progress'] = 1;

$config->database = $dbInfos;
if (!DbHelper::isDatabaseConnectionUTF8()) {
$config->database['charset'] = 'utf8';
}
$config->forceSave();

$config->forceSave();
}

private function checkPiwikIsNotInstalled()
Expand Down
5 changes: 0 additions & 5 deletions plugins/Installation/SystemCheck.php
Expand Up @@ -177,11 +177,6 @@ public static function getSystemInformation()

$infos['tracker_status'] = Common::getRequestVar('trackerStatus', 0, 'int');

$infos['protocol'] = ProxyHeaders::getProtocolInformation();
if (!\Piwik\ProxyHttp::isHttps() && $infos['protocol'] !== null) {
$infos['assume_secure_protocol'] = '1';
}

// check if filesystem is NFS, if it is file based sessions won't work properly
$infos['is_nfs'] = Filesystem::checkIfFileSystemIsNFS();
$infos = self::enrichSystemChecks($infos);
Expand Down
12 changes: 0 additions & 12 deletions plugins/Installation/templates/_systemCheckSection.twig
Expand Up @@ -288,18 +288,6 @@
</td>
</tr>
{% endif %}
{% if infos.assume_secure_protocol is defined %}
<tr>
<td class="label">{{ 'Installation_SystemCheckSecureProtocol'|translate }}</td>
<td>
{{ warning }} <span class="warn">{{ infos.protocol }} </span><br/>
{{ 'Installation_SystemCheckSecureProtocolHelp'|translate }}
<br/><br/>
<code>[General]<br/>
assume_secure_protocol = 1</code><br/>
</td>
</tr>
{% endif %}
{% if infos.extra.load_data_infile_available is defined %}
<tr>
<td class="label">{{ 'Installation_DatabaseAbilities'|translate }}</td>
Expand Down
10 changes: 10 additions & 0 deletions plugins/Installation/templates/systemCheck.twig
@@ -1,6 +1,16 @@
{% extends '@Installation/layout.twig' %}

{% block content %}

<script type="text/javascript">
$(function () {
// client-side test for https to handle the case where the server is behind a reverse proxy
if (document.location.protocol === 'https:') {
$('p.nextStep a').attr('href', $('p.nextStep a').attr('href') + '&clientProtocol=https');
}
});
</script>

{% if not showNextStep %}
{% include "@Installation/_systemCheckLegend.twig" %}
<br style="clear:both;">
Expand Down
5 changes: 0 additions & 5 deletions plugins/Installation/templates/welcome.twig
Expand Up @@ -16,11 +16,6 @@
<script type="text/javascript">
<!--
$(function () {
// client-side test for https to handle the case where the server is behind a reverse proxy
if (document.location.protocol === 'https:') {
$('p.nextStep a').attr('href', $('p.nextStep a').attr('href') + '&clientProtocol=https');
}
// client-side test for broken tracker (e.g., mod_security rule)
$('p.nextStep').hide();
$.ajax({
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/UI
Submodule UI updated from 66597f to a1277c

0 comments on commit cef8bd5

Please sign in to comment.