AccountManager: Don't force the server URL while loading the config.
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 28 Jun 2016 12:27:00 +0000 (14:27 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Tue, 28 Jun 2016 12:32:03 +0000 (14:32 +0200)
While loading the account, only override the server url if Theme::forceConfigAuthType
is set. This restore the behavior from the client 2.1 for theme that did not
use Theme::forceConfigAuthType.

Issue: owncloud/enterprise#1418

src/gui/accountmanager.cpp

index e4b386d765be20ae84993bdeb032b494701288e2..421ee0add82eb4f2e3cd04dba04f8d558101cbd6 100644 (file)
@@ -213,14 +213,12 @@ AccountPtr AccountManager::loadAccountHelper(QSettings& settings)
 
     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
+    QString forceAuth = Theme::instance()->forceConfigAuthType();
+    if(!forceAuth.isEmpty() && !overrideUrl.isEmpty() ) {
+        // If forceAuth is set, this might also mean the overrideURL has changed.
+        // See enterprise issues #1126
         acc->setUrl(overrideUrl);
-        auto forceAuth = Theme::instance()->forceConfigAuthType();
-        if (!forceAuth.isEmpty()) {
-            authType = forceAuth;
-        }
+        authType = forceAuth;
     } else {
         acc->setUrl(settings.value(QLatin1String(urlC)).toUrl());
     }