[Pkg-owncloud-commits] [owncloud-client] 30/33: Make "Sign Out" forget the cookies
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Feb 27 19:44:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch upstream
in repository owncloud-client.
commit 86073001952796ef1fcdcc2605ff00ec98c22c17
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Wed Feb 26 13:23:52 2014 +0100
Make "Sign Out" forget the cookies
If we keep the cookies, next time we sign in, the entered password
does not matter as the server still think our session is logged in.
---
src/mirall/account.cpp | 12 ++++++++++++
src/mirall/account.h | 1 +
src/mirall/application.cpp | 9 +++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/mirall/account.cpp b/src/mirall/account.cpp
index 6a15773..feb0ac0 100644
--- a/src/mirall/account.cpp
+++ b/src/mirall/account.cpp
@@ -342,4 +342,16 @@ void Account::slotHandleErrors(QNetworkReply *reply , QList<QSslError> errors)
}
}
+
+void Account::singOut()
+{
+ credentials()->invalidateToken(this);
+ if (_am) {
+ // Forget all cookies
+ _am->setCookieJar(new QNetworkCookieJar);
+ }
+ setState(Account::SignedOut);
+}
+
+
} // namespace Mirall
diff --git a/src/mirall/account.h b/src/mirall/account.h
index 6d8df04..4c00c84 100644
--- a/src/mirall/account.h
+++ b/src/mirall/account.h
@@ -145,6 +145,7 @@ public:
void setState(int state);
QuotaInfo *quotaInfo();
+ void singOut();
signals:
void stateChanged(int state);
diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp
index de84466..8424207 100644
--- a/src/mirall/application.cpp
+++ b/src/mirall/application.cpp
@@ -174,15 +174,16 @@ void Application::slotLogout()
{
Account *a = AccountManager::instance()->account();
if (a) {
- // invalidate & forget token/password
- a->credentials()->invalidateToken(a);
+ // forget the password and cookies and change the state
+ a->singOut();
+
// terminate all syncs and unload folders
FolderMan *folderMan = FolderMan::instance();
folderMan->setSyncEnabled(false);
folderMan->terminateSyncProcess();
folderMan->unloadAllFolders();
- a->setState(Account::SignedOut);
- // show result
+
+ // Show result
_gui->slotComputeOverallSyncStatus();
}
}
--
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