[Pkg-owncloud-commits] [owncloud-client] 20/175: Wizard: Allow SSL cert dialog to show twice. #3168

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Aug 8 10:36:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b9eafaaf2419476cc0918845baff0f141f89997c
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Fri May 8 10:17:21 2015 +0200

    Wizard: Allow SSL cert dialog to show twice. #3168
    
    Normally we never ask twice for the same url, but in the setup wizard
    it makes sense to do so.
---
 src/gui/owncloudsetupwizard.cpp | 4 ++++
 src/libsync/account.cpp         | 5 +++++
 src/libsync/account.h           | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp
index 6635c7b..9fa17e6 100644
--- a/src/gui/owncloudsetupwizard.cpp
+++ b/src/gui/owncloudsetupwizard.cpp
@@ -189,6 +189,10 @@ void OwncloudSetupWizard::slotNoOwnCloudFoundAuth(QNetworkReply *reply)
                             .arg(Theme::instance()->appNameGUI(),
                                  reply->url().toString(),
                                  reply->errorString()), checkDowngradeAdvised(reply));
+
+    // Allow the credentials dialog to pop up again for the same URL.
+    // Maybe the user just clicked 'Cancel' by accident or changed his mind.
+    _ocWizard->account()->resetSslCertErrorState();
 }
 
 void OwncloudSetupWizard::slotNoOwnCloudFoundAuthTimeout(const QUrl&url)
diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp
index c6aac47..8723a8b 100644
--- a/src/libsync/account.cpp
+++ b/src/libsync/account.cpp
@@ -400,6 +400,11 @@ void Account::addApprovedCerts(const QList<QSslCertificate> certs)
     _approvedCerts += certs;
 }
 
+void Account::resetSslCertErrorState()
+{
+    _treatSslErrorsAsFailure = false;
+}
+
 void Account::setSslErrorHandler(AbstractSslErrorHandler *handler)
 {
     _sslErrorHandler.reset(handler);
diff --git a/src/libsync/account.h b/src/libsync/account.h
index 0ae2977..3b8f07c 100644
--- a/src/libsync/account.h
+++ b/src/libsync/account.h
@@ -132,6 +132,11 @@ public:
     void setApprovedCerts(const QList<QSslCertificate> certs);
     void addApprovedCerts(const QList<QSslCertificate> certs);
 
+    // Usually when a user explicitly rejects a certificate we don't
+    // ask again. After this call, a dialog will again be shown when
+    // the next unknown certificate is encountered.
+    void resetSslCertErrorState();
+
     // pluggable handler
     void setSslErrorHandler(AbstractSslErrorHandler *handler);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list