Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Molkentin <danimo@owncloud.com>2014-01-20 22:46:09 +0400
committerDaniel Molkentin <danimo@owncloud.com>2014-01-20 22:46:09 +0400
commitd4bb0e44cdf7e7645ad917c97ef1cc091888d0f7 (patch)
tree5d6112fd97f8b1f7f69988b6f333e59447863ab2 /src/wizard
parent9b9b62d4e3da824e73c7e0a0a3aec17cd0e021e2 (diff)
Wizard: Gracefully fall back to HTTP if HTTPS connection fails
If the connection fails, the user is now being asked if he does agree to a new attempt via an unencrypted connection. If he complies, the connection will be reattempted using plain HTTP. Fixes #1356
Diffstat (limited to 'src/wizard')
-rw-r--r--src/wizard/owncloudsetuppage.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wizard/owncloudsetuppage.cpp b/src/wizard/owncloudsetuppage.cpp
index 4900695c6..abe63bd6d 100644
--- a/src/wizard/owncloudsetuppage.cpp
+++ b/src/wizard/owncloudsetuppage.cpp
@@ -17,6 +17,7 @@
#include <QFileDialog>
#include <QUrl>
#include <QPushButton>
+#include <QMessageBox>
#include "QProgressIndicator.h"
@@ -218,6 +219,18 @@ void OwncloudSetupPage::setErrorString( const QString& err )
if( err.isEmpty()) {
_ui.errorLabel->setVisible(false);
} else {
+ if (_ui.leUrl->text().startsWith("https://")) {
+ QString msg = tr("Could not connect securely. Do you want to connect unencrypted instead (not recommended)?").arg(err);
+ QString title = tr("Connection failed");
+ if (QMessageBox::question(this, title, msg, QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
+ QUrl url(_ui.leUrl->text());
+ url.setScheme("http");
+ _ui.leUrl->setText(url.toString());
+ // skip ahead to next page, since the user would expect us to retry automatically
+ wizard()->next();
+ }
+ }
+
_ui.errorLabel->setVisible(true);
_ui.errorLabel->setText(err);
}