added embedded verification method to login (this wants to be it's own object method, but should work well enough for now.)

some formatted cleanup for wizard.js
This commit is contained in:
chris@h-194.office.mozilla.org 2008-06-24 12:42:52 -07:00
parent 52a8ad1e41
commit 7a0411af09
2 changed files with 15 additions and 5 deletions

View File

@ -1,7 +1,6 @@
<!ENTITY serverError1.description "Server Error: ">
<!ENTITY serverError2.description ", ">
<!ENTITY wizard.title "Weave Setup">
<!ENTITY intro.title "Welcome to Weave">

View File

@ -499,11 +499,11 @@ WeaveSvc.prototype = {
// These are global (for all engines)
login: function WeaveSync_login(onComplete, password, passphrase) {
login: function WeaveSync_login(onComplete, password, passphrase, verifyonly) {
this._localLock(this._notify("login", this._login,
password, passphrase)).async(this, onComplete);
password, passphrase, verifyonly)).async(this, onComplete);
},
_login: function WeaveSync__login(password, passphrase) {
_login: function WeaveSync__login(password, passphrase, verifyonly) {
let self = yield;
// cache password & passphrase
@ -511,7 +511,10 @@ WeaveSvc.prototype = {
ID.get('WeaveID').setTempPassword(password);
ID.get('WeaveCryptoID').setTempPassword(passphrase);
this._log.debug("Logging in");
if(verifyonly)
this._log.debug("Verifying login");
else
this._log.debug("Logging in");
if (!this.username)
throw "No username set, login failed";
@ -536,6 +539,14 @@ WeaveSvc.prototype = {
throw "Login failed";
}
// If being called from the Wizard to verify credentials, stop here.
if (verifyonly) {
this._log.debug("Login verified");
self.done(true);
return;
}
// Otherwise, setup the user session.
this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix);
this._versionCheck.async(this, self.cb);