--HG--
extra : rebase_source : 4905bf56bf8efc90b49f99f56603a93908efdd63
This commit is contained in:
Anant Narayanan 2009-07-21 14:31:16 -07:00
Родитель 98dab3d018
Коммит d81a63e89a
5 изменённых файлов: 62 добавлений и 4 удалений

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

@ -1,9 +1,17 @@
<!ENTITY dialog.title "Sign In to Weave">
<!ENTITY dialog.login "Sign In">
<!ENTITY dialog.help "Help">
<!ENTITY whatsThis.label "What's this?">
<!ENTITY whatsThis.label "What's this?">
<!ENTITY username.label "Username:">
<!ENTITY password.label "Password:">
<!ENTITY encryptionPassphrase.label "Encryption Passphrase:">
<!ENTITY savePassword.label "Save password on this computer">
<!ENTITY autoconnect.label "Automatically connect each time I start Firefox">
<!ENTITY forgotPhrase.label "Forgot your passphrase?">
<!ENTITY pph.title "Reset your Passphrase">
<!ENTITY pph.message "Please update all your clients with the new passphrase">
<!ENTITY pph.accept "Reset">
<!ENTITY pph.cancel "Cancel">
<!ENTITY pph.enter1 "Enter new passphrase">
<!ENTITY pph.enter2 "Confirm new passphrase">

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

@ -1,4 +1,5 @@
loginFailed.alert = Login failed
noUsername.alert = You must enter a username
noPassword.alert = You must enter a password
noPassphrase.alert = You must enter a passphrase
samePasswordAndPassphrase.alert = Your password and passphrase must be different
@ -6,3 +7,7 @@ loginStart.label = Signing in, please wait...
loginError.label = Invalid username and/or password.
loginSuccess.label = Signed In
hide.label = Hide
pphStart.label = Resetting passphrase, please wait...
pphError.label = There was an error while resetting your passphrase!
pphSuccess.label = Your passphrase was successfully reset!
pphNoMatch.alert = Your passphrases do not match. Try again!

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

@ -22,6 +22,7 @@
<!ENTITY newPasswordAgain.label "Re-enter:">
<!ENTITY showPasswords.label "Show Passwords">
<!ENTITY changePasswordButton.label "Change Password">
<!ENTITY changePassphraseButton.label "Change Passphrase">
<!ENTITY backUpCheckbox.label "Back up and securely synchronize my data to a Weave server">
<!ENTITY encryptOnServerCheckbox.label "Encrypt locally and only store encrypted data on server">
@ -111,3 +112,10 @@
<!ENTITY tabs.sortBy.title.label "Title">
<!ENTITY tabs.sortBy.source.label "Source">
<!ENTITY tabs.sortBy.label "Sort by: ">
<!ENTITY pph.accept "Change">
<!ENTITY pph.cancel "Cancel">
<!ENTITY pph.title "Change passphrase">
<!ENTITY pph.message "Please update all your clients with the new phrase">
<!ENTITY pph.enterNew1 "New passphrase:">
<!ENTITY pph.enterNew2 "Confirm new passphrase:">

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

@ -21,3 +21,9 @@ change.password.status.passwordsDoNotMatch = The passwords you entered do not ma
change.password.status.noOldPassword = You didn't enter your current password.
change.password.status.noNewPassword = You didn't enter a new password.
change.password.status.badOldPassword = Your current password is incorrect.
change.passphrase.label = Changing passphrase, please wait...
change.passphrase.error = There was an error while changing your passphrase!
change.passphrase.success = Your passphrase was successfully changed!
change.passphrase.noMatchAlert = Your passphrases do not match. Try again!
change.passphrase.noPassAlert = You must enter the new passphrase

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

@ -517,6 +517,35 @@ WeaveSvc.prototype = {
// fixme: decrypt something here
}))),
changePassphrase: function WeaveSvc_changePassphrase(newphrase)
this._catch(this._notify("changepph", "", function() {
throw "Unimplemented!";
}))(),
resetPassphrase: function WeaveSvc_resetPassphrase(newphrase)
this._catch(this._notify("resetpph", "", function() {
/* Make remote commands ready so we have a list of clients beforehand */
this.prepCommand("logout", []);
let clientsBackup = Clients._store.clients;
/* Wipe */
this.wipeServer();
/* Set remote commands before syncing */
Clients._store.clients = clientsBackup;
let username = this.username;
let password = this.password;
this.logout();
/* Set this so UI is updated on next run */
this.passphrase = newphrase;
/* Login in sync: this also generates new keys */
this.login(username, password, newphrase);
this.sync(true);
return true;
}))(),
login: function WeaveSvc_login(username, password, passphrase)
this._catch(this._lock(this._notify("login", "", function() {
this._loggedIn = false;
@ -1073,6 +1102,7 @@ WeaveSvc.prototype = {
["resetEngine", 1, "Clear temporary local data for engine"],
["wipeAll", 0, "Delete all client data for all engines"],
["wipeEngine", 1, "Delete all client data for engine"],
["logout", 0, "Log out client"],
].reduce(function WeaveSvc__commands(commands, entry) {
commands[entry[0]] = {};
for (let [i, attr] in Iterator(["args", "desc"]))
@ -1097,7 +1127,7 @@ WeaveSvc.prototype = {
// Process each command in order
for each ({command: command, args: args} in commands) {
this._log.debug("Processing command: " + command + "(" + args + ")");
let engines = [args[0]];
switch (command) {
case "resetAll":
@ -1106,14 +1136,15 @@ WeaveSvc.prototype = {
case "resetEngine":
this.resetClient(engines);
break;
case "wipeAll":
engines = null;
// Fallthrough
case "wipeEngine":
this.wipeClient(engines);
break;
case "logout":
this.logout();
return false;
default:
this._log.debug("Received an unknown command: " + command);
break;