This commit is contained in:
Atul Varma 2008-06-30 15:54:21 -07:00
Родитель 1c43bf8988 a7d8315951
Коммит 69a5198bbf
2 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -494,26 +494,26 @@ WeaveSvc.prototype = {
// These are global (for all engines) // These are global (for all engines)
verifyLogin: function WeaveSvc_verifyLogin(username, password) { verifyLogin: function WeaveSvc_verifyLogin(username, password) {
this._log.debug("Verifying login for user " + username);
this._localLock(this._notify("verify-login", this._verifyLogin, this._localLock(this._notify("verify-login", this._verifyLogin,
username, password)).async(this, null); username, password)).async(this, null);
}, },
_verifyLogin: function WeaveSvc__verifyLogin(username, password) { _verifyLogin: function WeaveSvc__verifyLogin(username, password) {
let self = yield; let self = yield;
this._log.debug("Verifying login for user " + username);
DAV.baseURL = Utils.prefs.getCharPref("serverURL"); DAV.baseURL = Utils.prefs.getCharPref("serverURL");
DAV.defaultPrefix = "user/" + username; DAV.defaultPrefix = "user/" + username;
this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix); this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix);
let status = yield DAV.checkLogin.async(DAV, self.cb, username, password); let status = yield DAV.checkLogin.async(DAV, self.cb, username, password);
if (status == 404) { if (status == 404) {
// create user directory (for self-hosted webdav shares) // create user directory (for self-hosted webdav shares)
// XXX do this in login?
yield this._checkUserDir.async(this, self.cb); yield this._checkUserDir.async(this, self.cb);
status = yield DAV.checkLogin.async(DAV, self.cb, username, password); status = yield DAV.checkLogin.async(DAV, self.cb, username, password);
} }
Utils.ensureStatus(status, "Login verification failed"); Utils.ensureStatus(status, "Login verification failed");
}, },
@ -530,11 +530,8 @@ WeaveSvc.prototype = {
if (!this.password) if (!this.password)
throw "No password given or found in password manager"; throw "No password given or found in password manager";
DAV.baseURL = Utils.prefs.getCharPref("serverURL"); yield this._verifyLogin.async(this, self.cb, this.username,
DAV.defaultPrefix = "user/" + this.userPath; this.password);
this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix);
yield this._versionCheck.async(this, self.cb); yield this._versionCheck.async(this, self.cb);
yield this._getKeypair.async(this, self.cb); yield this._getKeypair.async(this, self.cb);

Просмотреть файл

@ -173,7 +173,7 @@ function FakeDAVService(contents) {
this.fakeContents = contents; this.fakeContents = contents;
DAV.__proto__ = this; DAV.__proto__ = this;
this.checkLogin = makeFakeAsyncFunc(true); this.checkLogin = makeFakeAsyncFunc(200);
} }
FakeDAVService.prototype = { FakeDAVService.prototype = {