Another automated merge. I'm kind of confused at this point, so I hope I'm not breaking anything by mis-merging.

This commit is contained in:
Atul Varma 2008-06-25 04:45:22 -07:00
Родитель 089a4f6a9d bab9cb62c9
Коммит 434d0a77bf
5 изменённых файлов: 207 добавлений и 183 удалений

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

@ -1,87 +1,91 @@
<!ENTITY serverError1.description "Server Error: ">
<!ENTITY serverError2.description ", ">
<!ENTITY serverError1.description "Server Error: ">
<!ENTITY serverError2.description ", ">
<!ENTITY wizard.title "Weave Setup">
<!ENTITY intro.title "Welcome to Weave">
<!ENTITY intro.description "[description of Weave]">
<!ENTITY intro-more.label "Learn more">
<!ENTITY intro-more.link "http://labs.mozilla.com">
<!ENTITY welcome.title "Installation Type">
<!ENTITY curUser-title.label "Sign In">
<!ENTITY curUser.description "Sign into your existing account to set up Weave on this computer.">
<!ENTITY newUser-title.label "Get Started with Weave">
<!ENTITY newUser.description "Create a new account.">
<!ENTITY verify.title "Account Verification (Step 1 of 3)">
<!ENTITY username.label "User name:">
<!ENTITY password.label "Password:">
<!ENTITY passphrase.label "Passphrase:">
<!ENTITY reminder.label "Forgot your password? ">
<!ENTITY unverified.label "Unverified">
<!ENTITY recovery.link "https://sm-labs01.mozilla.org:81/client/forgot.php">
<!ENTITY create.title "Create Account (Step 1 of 5)">
<!ENTITY createUsername.label "Desired login name:">
<!ENTITY createUsernameHint.label "Examples: Maria, Maria.Emerson">
<!ENTITY createPassword.label "Choose a password:">
<!ENTITY createPasswordHint.label "Minimum of 5 characters in length.">
<!ENTITY createReenterPassword.label "Re-enter password:">
<!ENTITY createEmail.label "Current email address:">
<!ENTITY createEmailHint.label "e.g. yourname@domain.com">
<!ENTITY create2.title "Create Account (Step 2 of 5)">
<!ENTITY passphrase.description "You must also now choose an encryption passphrase that is different from your password. This will be used to protect your data on the server.">
<!ENTITY passphrase-more.label "Learn More">
<!ENTITY passphrase-more.link "http://labs.mozilla.com">
<!ENTITY reenterPassphrase.label "Re-enter passphrase:">
<!ENTITY moreInfo.label "More information on choosing a phrase.">
<!ENTITY create3.title "Create Account (Step 3 of 5)">
<!ENTITY instanceName.description "Name this device... explain why... ">
<!ENTITY instanceName.label "Device name:">
<!ENTITY examples.label "Examples: &quot;Home computer&quot;, &quot;Mobile phone&quot;, &quot;Work laptop&quot;">
<!ENTITY data.description "Choose the data that you would like Weave to store for you.">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY history.label "Browsing History">
<!ENTITY cookies.label "Cookies">
<!ENTITY passwords.label "Saved Passwords">
<!ENTITY tabs.label "Tabs">
<!ENTITY formdata.label "Saved Form Data">
<!ENTITY data.note "Weave will synchronize this data every 30 seconds.">
<!ENTITY removeBookmarks.label "Remove default bookmarks on this device before synchronizing with Weave.">
<!ENTITY captcha.label "Type the characters you see in the image below:">
<!ENTITY captchaDirections.label "">
<!ENTITY reloadCaptcha.text "Reload">
<!ENTITY captchaHint.label "Letters are not case-sensitive.">
<!ENTITY terms.label "Terms of Service">
<!ENTITY acceptTerms.label "I have read and accept the Terms of Service.">
<!ENTITY final.description "Your account will be created with the following preferences [this screen in progress]">
<!ENTITY initialLogin.label "Signing you in.">
<!ENTITY initialPrefs.label "Setting your preferences.">
<!ENTITY initialReset.label "Clearing your default bookmarks.">
<!ENTITY initialSync.label "Synchronizing your data.">
<!ENTITY finalStep1Finished.label "Signed in.">
<!ENTITY finalStep2.label "Synchronizing data...">
<!ENTITY finalStep3Finished.label "Data synchronized.">
<!ENTITY wizard.title "Weave Setup">
<!ENTITY thankyou.title "Thank you!">
<!ENTITY thankyou.description "You successfully installed Weave. etc... ">
<!ENTITY intro.title "Welcome to Weave">
<!ENTITY intro.description "[description of Weave]">
<!ENTITY intro-more.label "Learn more">
<!ENTITY intro-more.link "http://labs.mozilla.com">
<!ENTITY welcome.title "Installation Type">
<!ENTITY curUser-title.label "Sign In">
<!ENTITY curUser.description "Sign into your existing account to set up Weave on this computer.">
<!ENTITY newUser-title.label "Get Started with Weave">
<!ENTITY newUser.description "Create a new account.">
<!ENTITY verify.title "Account Verification (Step 1 of 3)">
<!ENTITY username.label "User name:">
<!ENTITY password.label "Password:">
<!ENTITY passphrase.label "Passphrase:">
<!ENTITY reminder.label "Forgot your password? ">
<!ENTITY unverified.label "Unverified">
<!ENTITY recovery.link "https://sm-labs01.mozilla.org:81/client/forgot.php">
<!ENTITY create.title "Create Account (Step 1 of 5)">
<!ENTITY createUsername.label "Desired login name:">
<!ENTITY createUsernameHint.label "Examples: Maria, Maria.Emerson">
<!ENTITY createPassword.label "Choose a password:">
<!ENTITY createPasswordHint.label "Minimum of 5 characters in length.">
<!ENTITY createReenterPassword.label "Re-enter password:">
<!ENTITY createEmail.label "Current email address:">
<!ENTITY createEmailHint.label "e.g. yourname@domain.com">
<!ENTITY create2.title "Create Account (Step 2 of 5)">
<!ENTITY passphrase.description "You must also now choose an encryption passphrase that is different from your password. This will be used to protect your data on the server.">
<!ENTITY passphrase-more.label "Learn More">
<!ENTITY passphrase-more.link "http://labs.mozilla.com">
<!ENTITY reenterPassphrase.label "Re-enter passphrase:">
<!ENTITY moreInfo.label "More information on choosing a phrase.">
<!ENTITY create3.title "Create Account (Step 3 of 5)">
<!ENTITY instanceName.description "Name this device... explain why... ">
<!ENTITY instanceName.label "Device name:">
<!ENTITY examples.label "Examples: &quot;Home computer&quot;, &quot;Mobile phone&quot;, &quot;Work laptop&quot;">
<!ENTITY data.description "Choose the data that you would like Weave to store for you.">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY history.label "Browsing History">
<!ENTITY cookies.label "Cookies">
<!ENTITY passwords.label "Saved Passwords">
<!ENTITY tabs.label "Tabs">
<!ENTITY formdata.label "Saved Form Data">
<!ENTITY data.note "Weave will synchronize this data every 30 seconds.">
<!ENTITY removeBookmarks.label "Remove default bookmarks on this device before synchronizing with Weave.">
<!ENTITY captcha.label "Type the characters you see in the image below:">
<!ENTITY captchaDirections.label "">
<!ENTITY reloadCaptcha.text "Reload">
<!ENTITY captchaHint.label "Letters are not case-sensitive.">
<!ENTITY terms.label "Terms of Service">
<!ENTITY acceptTerms.label "I have read and accept the Terms of Service.">
<!ENTITY final.description "Installing Weave...">
<!ENTITY initialLogin.label "Signing you in.">
<!ENTITY initialPrefs.label "Setting your preferences.">
<!ENTITY initialReset.label "Clearing your default bookmarks.">
<!ENTITY initialSync.label "Synchronizing your data.">
<!ENTITY finalStep1Finished.label "Signed in.">
<!ENTITY finalStep2.label "Synchronizing data...">
<!ENTITY finalStep3Finished.label "Data synchronized.">
<!ENTITY userCheckFailed1.description "Our server is having problems and we couldn't check that username. ">
<!ENTITY userCheckFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY finished.description "Good job. You installed Weave. You can change preferences in the Weave tab...">
<!ENTITY initialLoginFailed1.description "Our server is having problems and we couldn't log you in. ">
<!ENTITY initialLoginFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY initialSyncFailed1.description "Our server is having problems and we couldn't synchronize your data. ">
<!ENTITY initialSyncFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY clickHere.text "Click here">
<!ENTITY tryAgain.text "Try again">
<!ENTITY final-pref-title.description "Preferences"> <!ENTITY final-account-title.description "Account"> <!ENTITY final-sync-title.description "Initial Synchronization">
<!ENTITY userCheckFailed1.description "Our server is having problems and we couldn't check that username. ">
<!ENTITY userCheckFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY finished.description "Good job. You installed Weave. You can change preferences in the Weave tab...">
<!ENTITY initialLoginFailed1.description "Our server is having problems and we couldn't log you in. ">
<!ENTITY initialLoginFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY initialSyncFailed1.description "Our server is having problems and we couldn't synchronize your data. ">
<!ENTITY initialSyncFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY clickHere.text "Click here">
<!ENTITY tryAgain.text "Try again">

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

@ -1,52 +1,73 @@
serverError.label = Server Error
serverTimeoutError.label = Server Error
serverError.label = Server Error
serverTimeoutError.label = Server Error
createUsername-progress.label = Checking username
createUsername-error.label = %S is already taken. Please choose another.
createUsername-success.label = %S is available.
email-progress.label = Checking email
email-unavailable.label = %S is already taken. Please choose another.
email-invalid.label = Please re-enter a valid email address.
email-success.label = %S is available.
passwordsUnmatched.label = Passwords do not match
passphrasesUnmatched.label = Passphrases do not match.
samePasswordAndPassphrase.label = Your password and passphrase must be different
missingCaptchaResponse.label = Please enter the words in the Captcha box.
incorrectCaptcha.label = Incorrect Captcha response. Try again.
verify-progress.label = Verifying username and password
verify-error.label = Invalid username and password
verify-success.label = Username and password verified
create-progress.label = Creating your account
create-uid-inuse.label = Username in use
create-uid-missing.label = Username missing
create-uid-invalid.label = Username invalid
create-mail-invalid.label = Email invalid
create-mail-inuse.label = Emali in use
create-captcha-missing.label = Captcha response missing
create-password-missing.label = Password missing
create-password-incorrect.label = Password incorrect
create-success.label = Account for %S created.
createUsername-progress.label =
createUsername-error.label = %S is already taken. Please choose another.
createUsername-success.label = %S is available.
final-pref-value.label = %S
final-account-value.label = Username: %S
final-sync-value.label = [Explain that a sync will happen]
final-success.label = Weave was successfully installed.
email-progress.label =
email-unavailable.label = %S is already taken. Please choose another.
email-invalid.label = Please re-enter a valid email address.
email-success.label = %S is available.
default-name.label = %S's Firefox
default-name-nouser.label = Firefox
bookmarks.label = Bookmarks
history.label = Browsing History
cookies.label = Cookies
passwords.label = Saved Passwords
tabs.label = Tabs
formdata.label = Saved Form Data
initialLogin-progress.label = Signing you in
initialLogin-error.label = Problem signing in.
initialPrefs-progress.label = Setting your preferences
passwordsUnmatched.label = Passwords do not match
passphrasesUnmatched.label = Passphrases do not match.
samePasswordAndPassphrase.label = Your password and passphrase must be different
missingCaptchaResponse.label = Please enter the words in the Captcha box.
incorrectCaptcha.label = Incorrect Captcha response. Try again.
verify-progress.label = Verifying username and password
verify-error.label = Invalid username and password
verify-success.label = Username and password verified
initialLogin-progress.label = Signing you in...
initialLogin-done.label = Sign-in successful.
initialLogin-error.label = Problem signing in.
initialPrefs-progress.label = Setting your preferences...
initialPrefs-done.label = Preferences set.
initialReset-progress.label = Clearing your default bookmarks...
initialReset-done.label = Default bookmarks cleared.
initialSync-progress.label = Synchronizing your data...
initialSync-done.label = Sync successful.
initialSync-progress.label = Synchronizing your data
initialSync-error.label = Problem syncing data.
tryAgain.text = Try again now.
clickHere.text = Click here
data-verify.title = Data (Step 2 of 3)
data-create.title = Data (Step 4 of 5)
final-verify.title = Finish (Step 3 of 3)
final-create.title = Finish (Step 5 of 5)
installation-complete.label = Installation complete.
tryAgain.text = Try again now.
clickHere.text = Click here
data-verify.title = Data (Step 2 of 3)
data-create.title = Data (Step 4 of 5)
final-verify.title = Finish (Step 3 of 3)
final-create.title = Finish (Step 5 of 5)

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

@ -301,21 +301,32 @@ DAVCollection.prototype = {
// Login / Logout
checkLogin: function DC_checkLogin() {
checkLogin: function DC_checkLogin(username, password) {
let self = yield;
this._log.debug("Checking login");
this._log.debug("checkLogin called for user " + username);
let headers = {
'Content-type' : 'text/plain',
'Authorization' : 'Basic ' + btoa(username + ":" + password)
};
let lock = DAVLocks['default'];
if (lock)
headers['If'] = "<" + lock.URL + "> (<" + lock.token + ">)";
// Make a call to make sure it's working
this.GET("", self.cb);
this._makeRequest.async(this, self.cb, "GET", "", headers);
let resp = yield;
if (resp.status < 200 || resp.status >= 300) {
self.done(false);
return;
}
this._log.debug("checkLogin got response status " + resp.status);
// XXX would be nice if 404 == invalid username, 401 == invalid password.
let retmsg = "";
if (resp.status == 401)
retmsg = "invalid username or password";
else if (resp.status < 200 || resp.status >= 300)
retmsg = "server error";
self.done(true);
self.done(retmsg);
},
// Locking

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

@ -196,10 +196,8 @@ WeaveSvc.prototype = {
get userPath() { return ID.get('WeaveID').username; },
get currentUser() {
if (this._loggedIn)
return this.username;
return null;
get isLoggedIn() {
return this._loggedIn;
},
get enabled() {
@ -499,22 +497,36 @@ WeaveSvc.prototype = {
// These are global (for all engines)
login: function WeaveSync_login(onComplete, password, passphrase, verifyonly) {
this._localLock(this._notify("login", this._login,
password, passphrase, verifyonly)).async(this, onComplete);
verifyLogin: function WeaveSync_verifyLogin(username, password) {
this._localLock(this._notify("verify-login", this._verifyLogin, username, password)).async(this, null);
},
_login: function WeaveSync__login(password, passphrase, verifyonly) {
_verifyLogin: function WeaveSync__verifyLogin(username, password) {
let self = yield;
this._log.debug("Verifying login for user " + username);
DAV.baseURL = Utils.prefs.getCharPref("serverURL");
DAV.defaultPrefix = "user/" + username;
DAV.checkLogin.async(DAV, self.cb, username, password);
let resultMsg = yield;
// If we got an error message, throw it. [need to throw to cause the
// _notify() wrapper to generate an error notification for observers].
if (resultMsg) {
this._log.debug("Login verification: " + resultMsg);
throw resultMsg;
}
},
login: function WeaveSync_login(onComplete) {
this._localLock(this._notify("login", this._login)).async(this, onComplete);
},
_login: function WeaveSync__login() {
let self = yield;
// cache password & passphrase
// if null, we'll try to get them from the pw manager below
ID.get('WeaveID').setTempPassword(password);
ID.get('WeaveCryptoID').setTempPassword(passphrase);
if(verifyonly)
this._log.debug("Verifying login");
else
this._log.debug("Logging in");
this._log.debug("Logging in user " + this.username);
if (!this.username)
throw "No username set, login failed";
@ -524,29 +536,6 @@ WeaveSvc.prototype = {
DAV.baseURL = Utils.prefs.getCharPref("serverURL");
DAV.defaultPrefix = "user/" + this.userPath;
DAV.checkLogin.async(DAV, self.cb, this.username, this.password);
let success = yield;
if (!success) {
try {
// FIXME: This code may not be needed any more, due to the way
// that the server is expected to create the user dir for us.
this._checkUserDir.async(this, self.cb);
yield;
} catch (e) { /* FIXME: tmp workaround for services.m.c */ }
DAV.checkLogin.async(DAV, self.cb, this.username, this.password);
let success = yield;
if (!success)
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);

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

@ -177,11 +177,11 @@ HTTPPollingTransport.prototype = {
this._retryCap = 0;
},
__request: null,
get _request() {
if (!this.__request)
this.__request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( Ci.nsIXMLHttpRequest );
return this.__request;
let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( Ci.nsIXMLHttpRequest );
request.mozBackgroundRequest = true;
this.__defineGetter__("_request", function() request);
return this._request;
},
__hasher: null,
@ -256,7 +256,6 @@ HTTPPollingTransport.prototype = {
_doPost: function( requestXml ) {
var request = this._request;
request.mozBackgroundRequest = true;
var callbackObj = this._callbackObject;
var self = this;
var contents = "";