Clear cached file sync credentials/URLs when changing settings

This commit is contained in:
aurimasv 2014-04-20 20:39:45 -05:00
parent f70d0c0b29
commit 9b63ca5f4d
4 changed files with 14 additions and 1 deletions

View file

@ -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);
},

View file

@ -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

View file

@ -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

View file

@ -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;