www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 499ab285397e55446005d72a5844f35fbc743289
parent b758af7b08edf751c1b0c3957e509ccb4898ef77
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 24 Apr 2014 01:30:15 -0400

Merge pull request #471 from aurimasv/sync-cred

Clear cached file sync credentials/URLs when changing settings
Diffstat:
Mchrome/content/zotero/preferences/preferences_sync.js | 1+
Mchrome/content/zotero/xpcom/storage/webdav.js | 5+++++
Mchrome/content/zotero/xpcom/storage/zfs.js | 6+++++-
Mchrome/content/zotero/xpcom/sync.js | 3+++
4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/preferences/preferences_sync.js b/chrome/content/zotero/preferences/preferences_sync.js @@ -151,6 +151,7 @@ Zotero_Preferences.Sync = { unverifyStorageServer: function () { Zotero.Prefs.set('sync.storage.verified', false); + Zotero.Sync.Storage.WebDAV.clearCachedCredentials(); Zotero.Sync.Storage.resetAllSyncStates(null, true, false); }, diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -827,6 +827,11 @@ Zotero.Sync.Storage.WebDAV = (function () { _rootURI = uri; }; + + obj.clearCachedCredentials = function() { + _rootURI = _parentURI = undefined; + _cachedCredentials = false; + }; /** * Begin download process for individual file diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js @@ -675,7 +675,7 @@ Zotero.Sync.Storage.ZFS = (function () { }); - obj._init = function (url, username, password) { + obj._init = function () { _rootURI = false; _userURI = false; @@ -695,6 +695,10 @@ Zotero.Sync.Storage.ZFS = (function () { _userURI = uri; }; + obj.clearCachedCredentials = function() { + _rootURI = _userURI = undefined; + _cachedCredentials = false; + }; /** * Begin download process for individual file diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -1277,6 +1277,9 @@ Zotero.Sync.Server = new function () { break; } + // Clear password for file sync + Zotero.Sync.Storage.ZFS.clearCachedCredentials(); + _cachedCredentials = {}; var username = this.username;