[Pkg-owncloud-commits] [owncloud-client] 341/470: AccountManager: take theURL from the Theme rather than from the config if the theme specify it (#4591)
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:23 UTC 2016
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 fafca26144dec9ace606604125aa80c13b8229e7
Author: Olivier Goffart <olivier at woboq.com>
Date: Fri Apr 15 13:16:49 2016 +0200
AccountManager: take theURL from the Theme rather than from the config if the theme specify it (#4591)
That way an upgrade of the client can actually change the URL
Issue https://github.com/owncloud/enterprise/issues/1113
https://github.com/owncloud/enterprise/issues/1126
In addition to restoring commit 7e5d89293d7bd52ac42d026d34a8154fbbdf33bb, this
add a way to override the auth type
---
src/gui/accountmanager.cpp | 18 +++++++++++++++---
src/libsync/theme.cpp | 6 ++++++
src/libsync/theme.h | 7 +++++++
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp
index 90924bb..e4b386d 100644
--- a/src/gui/accountmanager.cpp
+++ b/src/gui/accountmanager.cpp
@@ -211,19 +211,31 @@ AccountPtr AccountManager::loadAccountHelper(QSettings& settings)
{
auto acc = createAccount();
- acc->setUrl(settings.value(QLatin1String(urlC)).toUrl());
+ QString authType = settings.value(QLatin1String(authTypeC)).toString();
+ QString overrideUrl = Theme::instance()->overrideServerUrl();
+ if( !overrideUrl.isEmpty() ) {
+ // if there is a overrideUrl, don't even bother reading from the config as all the accounts
+ // must use the overrideUrl
+ acc->setUrl(overrideUrl);
+ auto forceAuth = Theme::instance()->forceConfigAuthType();
+ if (!forceAuth.isEmpty()) {
+ authType = forceAuth;
+ }
+ } else {
+ acc->setUrl(settings.value(QLatin1String(urlC)).toUrl());
+ }
acc->_serverVersion = settings.value(QLatin1String(serverVersionC)).toString();
// We want to only restore settings for that auth type and the user value
acc->_settingsMap.insert(QLatin1String(userC), settings.value(userC));
- QString authTypePrefix = settings.value(authTypeC).toString() + "_";
+ QString authTypePrefix = authType + "_";
Q_FOREACH(QString key, settings.childKeys()) {
if (!key.startsWith(authTypePrefix))
continue;
acc->_settingsMap.insert(key, settings.value(key));
}
- acc->setCredentials(CredentialsFactory::create(settings.value(QLatin1String(authTypeC)).toString()));
+ acc->setCredentials(CredentialsFactory::create(authType));
// now the cert, it is in the general group
settings.beginGroup(QLatin1String("General"));
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index 1bc3477..62eccb5 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -216,6 +216,12 @@ QString Theme::overrideServerUrl() const
return QString::null;
}
+QString Theme::forceConfigAuthType() const
+{
+ return QString();
+}
+
+
QString Theme::defaultClientFolder() const
{
return appName();
diff --git a/src/libsync/theme.h b/src/libsync/theme.h
index 4fedd41..657e469 100644
--- a/src/libsync/theme.h
+++ b/src/libsync/theme.h
@@ -130,6 +130,13 @@ public:
virtual QString overrideServerUrl() const;
/**
+ * This is only usefull when previous version had a different overrideServerUrl
+ * with a different auth type in that case You should then specify "http" or "shibboleth".
+ * Normaly this should be left empty.
+ */
+ virtual QString forceConfigAuthType() const;
+
+ /**
* The default folder name without path on the server at setup time.
*/
virtual QString defaultServerFolder() const;
--
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