diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-18 07:44:02 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-18 07:44:02 +0300 |
commit | ccf46e76d32c6d295fcd901857d9d0773f7d419a (patch) | |
tree | d3f8c0d9a84688be2355e15f45adc77680b74c4b | |
parent | 74f0d0ff2529aed1ce07bb2409ea204c9cadd99c (diff) |
#6441 Update messages + new options when updating over HTTPS fails
-rw-r--r-- | plugins/CoreUpdater/lang/en.json | 7 | ||||
-rw-r--r-- | plugins/CoreUpdater/templates/oneClickResults.twig | 91 | ||||
-rw-r--r-- | tests/UI/specs/CoreUpdaterCode_spec.js | 8 |
3 files changed, 62 insertions, 44 deletions
diff --git a/plugins/CoreUpdater/lang/en.json b/plugins/CoreUpdater/lang/en.json index 2c3ffb9be2..83b946f002 100644 --- a/plugins/CoreUpdater/lang/en.json +++ b/plugins/CoreUpdater/lang/en.json @@ -48,9 +48,10 @@ "UpdateHasBeenCancelledExplanation": "Piwik One Click Update has been cancelled. If you can't fix the above error message, it is recommended that you manually update Piwik. %1$s Please check out the %2$sUpdate documentation%3$s to get started!", "UpdateTitle": "Update", "UpdateUsingHttpsFailed": "Downloading the latest Piwik version over secure HTTPS connection did not succeed, because of the following error:", - "UpdateUsingHttpsFailedHelp": "Please note that downloading the latest Piwik version (over secure HTTPS connection) can fail for various reasons, for example in case of network error, slow network speed, or wrong system configuration.", - "UpdateUsingHttpsFailedHelpWhatToDo": "You may continue the update via the non-secure standard HTTP connection by clicking on the button '%s'.", - "UpdateUsingHttpMessage": "Update Piwik automatically (over the non secure HTTP connection)", + "UpdateUsingHttpsFailedHelp": "Why did it fail? Downloading the latest Piwik version (over secure HTTPS connection) can fail for various reasons, for example because of a network error, slow network speed or wrong system configuration. Note that it could also mean that your server is the target of a MITM attack and someone is trying to replace the update with a malicious version of Piwik.", + "UpdateUsingHttpsFailedHelpWhatToDo": "It is recommended to retry the download using the secure HTTPS connection as it prevents MITM attacks.", + "UsingHttps": "using the secure HTTPS connection (recommended)", + "UsingHttp": "using the non-secure HTTP connection", "UpgradeComplete": "Upgrade complete!", "UpgradePiwik": "Upgrade Piwik", "VerifyingUnpackedFiles": "Verifying the unpacked files", diff --git a/plugins/CoreUpdater/templates/oneClickResults.twig b/plugins/CoreUpdater/templates/oneClickResults.twig index 8ded5fd604..c65d20aa2a 100644 --- a/plugins/CoreUpdater/templates/oneClickResults.twig +++ b/plugins/CoreUpdater/templates/oneClickResults.twig @@ -1,50 +1,61 @@ {% extends '@CoreUpdater/layout.twig' %} {% block content %} -<br/> -{% for message in feedbackMessages %} - <p>✓ {{ message }}</p> -{% endfor %} -{% if httpsFail %} - <br/> - <br/> - <div class="warning"> - <img src="plugins/Morpheus/images/warning_medium.png"/> - {{ 'CoreUpdater_UpdateUsingHttpsFailed'|translate }}<br/> - "{{ error }}" - </div> - <p>{{ 'CoreUpdater_UpdateUsingHttpsFailedHelp'|translate }}</p> - <p>{{ 'CoreUpdater_UpdateUsingHttpsFailedHelpWhatToDo'|translate('CoreUpdater_UpdateAutomatically'|translate) }}</p> - <div class="warning"> - {{ 'CoreUpdater_UpdateUsingHttpMessage'|translate }} - <form id="oneclickupdate" action="index.php"> + {% for message in feedbackMessages %} + <p>✓ {{ message }}</p> + {% endfor %} + + {% if httpsFail %} + <br/> + <br/> + <div class="warning"> + <img src="plugins/Morpheus/images/warning_medium.png"/> + {{ 'CoreUpdater_UpdateUsingHttpsFailed'|translate }}<br/> + "{{ error }}" + </div> + <p>{{ 'CoreUpdater_UpdateUsingHttpsFailedHelp'|translate }}</p> + <p>{{ 'CoreUpdater_UpdateUsingHttpsFailedHelpWhatToDo'|translate }}</p> + <form action="index.php"> + <input type="hidden" name="module" value="CoreUpdater"/> + <input type="hidden" name="action" value="oneClickUpdate"/> + <input type="hidden" name="https" value="1"/> + <input id="updateUsingHttps" type="submit" value="{{ 'CoreUpdater_UpdateAutomatically'|translate }}"/> + {{ 'CoreUpdater_UsingHttps'|translate }} + </form> + <form action="index.php"> <input type="hidden" name="module" value="CoreUpdater"/> <input type="hidden" name="action" value="oneClickUpdate"/> <input type="hidden" name="https" value="0"/> - <input id="updateUsingHttp" type="submit" class="submit" value="{{ 'CoreUpdater_UpdateAutomatically'|translate }}"/> + <input id="updateUsingHttp" type="submit" value="{{ 'CoreUpdater_UpdateAutomatically'|translate }}"/> + {{ 'CoreUpdater_UsingHttp'|translate }} + </form> + <form action="index.php"> + <input type="submit" value="{{ 'General_ContinueToPiwik'|translate }}"/> + </form> + <br/> + {% elseif error %} + <br/> + <br/> + <div class="error"> + <img src="plugins/Morpheus/images/error_medium.png"/> + {{ error }} + </div> + <br/> + <br/> + <div class="warning"> + <img src="plugins/Morpheus/images/warning_medium.png"/> + {{ 'CoreUpdater_UpdateHasBeenCancelledExplanation'|translate("<br /><br />","<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/update/'>","</a>")|raw }} + </div> + <br/> + <br/> + <form action="index.php"> + <input type="submit" class="submit" value="{{ 'General_ContinueToPiwik'|translate }}"/> + </form> + {% else %} + <form action="index.php"> + <input type="submit" class="submit" value="{{ 'General_ContinueToPiwik'|translate }}"/> </form> - </div> - <br/> - <br/> -{% elseif error %} - <br/> - <br/> - <div class="error"> - <img src="plugins/Morpheus/images/error_medium.png"/> - {{ error }} - </div> - <br/> - <br/> - <div class="warning"> - <img src="plugins/Morpheus/images/warning_medium.png"/> - {{ 'CoreUpdater_UpdateHasBeenCancelledExplanation'|translate("<br /><br />","<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/update/'>","</a>")|raw }} - </div> - <br/> - <br/> -{% endif %} + {% endif %} -<form action="index.php"> - <input type="submit" class="submit" value="{{ 'General_ContinueToPiwik'|translate }}"/> -</form> {% endblock %} diff --git a/tests/UI/specs/CoreUpdaterCode_spec.js b/tests/UI/specs/CoreUpdaterCode_spec.js index 807810869b..d1172b7bb7 100644 --- a/tests/UI/specs/CoreUpdaterCode_spec.js +++ b/tests/UI/specs/CoreUpdaterCode_spec.js @@ -20,12 +20,18 @@ describe("CoreUpdaterCode", function () { }, done); }); - it("should offer to update over http when updating over https fails", function (done) { + it("should offer to retry using https when updating over https fails", function (done) { expect.screenshot("httpsUpdateFail").to.be.capture(function (page) { page.click('#updateAutomatically'); }, done); }); + it("should offer to retry over http when updating over https fails", function (done) { + expect.screenshot("httpsUpdateFail").to.be.capture(function (page) { + page.click('#updateUsingHttps'); + }, done); + }); + it("should show the update steps when updating over http succeeds", function (done) { expect.screenshot("httpUpdateSuccess").to.be.capture(function (page) { page.click('#updateUsingHttp'); |