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
path: root/src
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-05-21 16:28:05 +0300
committerHannah von Reth <vonreth@kde.org>2021-05-26 17:43:25 +0300
commit7b793a444841fb318004ea6061410657e2825517 (patch)
tree4d546d6b138e4b827c726ac61e7eb89e585f356f /src
parent81c78fd0db506c5a38b6ae84976d36ec5bffbb0d (diff)
Ensure cookies are cleared right before the server check
Diffstat (limited to 'src')
-rw-r--r--src/gui/accountstate.cpp6
-rw-r--r--src/gui/connectionvalidator.cpp1
-rw-r--r--src/gui/connectionvalidator.h4
-rw-r--r--src/libsync/theme.cpp5
-rw-r--r--src/libsync/theme.h7
5 files changed, 22 insertions, 1 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 05f92dfa6..46b89d810 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -21,6 +21,7 @@
#include "logger.h"
#include "configfile.h"
#include "settingsdialog.h"
+#include "theme.h"
#include <QMessageBox>
#include <QSettings>
@@ -262,7 +263,6 @@ void AccountState::checkConnectivity(bool verifyServerState)
}
if (verifyServerState) {
- _account->clearCookieJar();
_queueGuard.block();
}
ConnectionValidator *conValidator = new ConnectionValidator(account());
@@ -273,6 +273,10 @@ void AccountState::checkConnectivity(bool verifyServerState)
// Use a small authed propfind as a minimal ping when we're
// already connected.
if (verifyServerState) {
+ if (Theme::instance()->connectionValidatorClearCookies()) {
+ // clear the cookies directly before we try to validate
+ connect(conValidator, &ConnectionValidator::aboutToStart, _account.get(), &Account::clearCookieJar, Qt::DirectConnection);
+ }
conValidator->checkServer();
} else {
conValidator->checkServerAndUpdate();
diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp
index d44117cad..e9e0754c6 100644
--- a/src/gui/connectionvalidator.cpp
+++ b/src/gui/connectionvalidator.cpp
@@ -96,6 +96,7 @@ void ConnectionValidator::slotCheckServerAndAuth()
_errors.append(tr("timeout"));
reportResult(Timeout);
});
+ Q_EMIT aboutToStart();
checkJob->start();
}
diff --git a/src/gui/connectionvalidator.h b/src/gui/connectionvalidator.h
index 27eb09a43..41847245e 100644
--- a/src/gui/connectionvalidator.h
+++ b/src/gui/connectionvalidator.h
@@ -106,6 +106,10 @@ public slots:
void systemProxyLookupDone(const QNetworkProxy &proxy);
signals:
+ /**
+ * Emited before the actual validation starts
+ */
+ void aboutToStart();
void connectionResult(ConnectionValidator::Status status, const QStringList &errors);
protected slots:
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index ab7be792b..71e45cfb3 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -648,4 +648,9 @@ bool Theme::enableExperimentalFeatures() const
return ConfigFile().showExperimentalOptions();
}
+bool Theme::connectionValidatorClearCookies() const
+{
+ return false;
+}
+
} // end namespace client
diff --git a/src/libsync/theme.h b/src/libsync/theme.h
index b514f0d2d..f98bc5865 100644
--- a/src/libsync/theme.h
+++ b/src/libsync/theme.h
@@ -407,6 +407,13 @@ public:
*/
virtual bool enableExperimentalFeatures() const;
+ /**
+ * Whether to clear cookies before checking status.php
+ * This is used with F5 BIG-IP seups.
+ */
+ virtual bool connectionValidatorClearCookies() const;
+
+
protected:
#ifndef TOKEN_AUTH_ONLY
QIcon themeUniversalIcon(const QString &name, IconType iconType = IconType::BrandedIcon) const;