From 55474654a185e20c0e1b6f2bfd62671ad4bc0c69 Mon Sep 17 00:00:00 2001 From: "cbeard@h-135.office.mozilla.org" Date: Wed, 26 Sep 2007 17:34:36 -0700 Subject: [PATCH] added wizard to setup service and get login information for new users updated server pointers to point to the new services.mozilla.com backend --- services/sync/nsBookmarksSyncService.js | 32 ++++++++++++++++++------- services/sync/services-sync.js | 8 +++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/services/sync/nsBookmarksSyncService.js b/services/sync/nsBookmarksSyncService.js index e6095dd8ffe..e62778b27b9 100644 --- a/services/sync/nsBookmarksSyncService.js +++ b/services/sync/nsBookmarksSyncService.js @@ -1120,7 +1120,7 @@ DAVCollection.prototype = { 'Use your ldap username/password - dotmoz'); LOG("Found " + logins.length + " logins"); - for (let i = 0; i < logins.length; i++) { + for (let i = 0; i < logins.length; i++) { if (logins[i].username == username) { password = logins[i].password; break; @@ -1154,14 +1154,30 @@ DAVCollection.prototype = { } // fixme: hacktastic - let hello = /Hello (.+)@mozilla.com/.exec(event.target.responseText) - if (hello) { - this._currentUserPath = hello[1]; - this._currentUser = this._currentUserPath + "@mozilla.com"; - this._baseURL = "http://dotmoz.mozilla.org/~" + - this._currentUserPath + "/"; - } +// let hello = /Hello (.+)@mozilla.com/.exec(event.target.responseText) +// let hello = /Index of/.exec(event.target.responseText) +// if (hello) { +// this._currentUserPath = hello[1]; +// this._currentUser = this._currentUserPath + "@mozilla.com"; +// this._baseURL = "http://dotmoz.mozilla.org/~" + +// this._currentUserPath + "/"; +// } + // XXX we need to refine some server response codes + let branch = Cc["@mozilla.org/preferences-service;1"]. + getService(Ci.nsIPrefBranch); + this._currentUser = branch.getCharPref("browser.places.sync.username"); + + // XXX + let path = this._currentUser.split("@"); + this._currentUserPath = path[0]; + +LOG("currentUser: "+this._currentUser); +LOG("currentUSerPath: "+this._currentUserPath); + + let serverURL = branch.getCharPref("browser.places.sync.serverURL"); + this._baseURL = serverURL + this._currentUserPath + "/"; + this._loggedIn = true; if (this._loginHandlers && this._loginHandlers.load) diff --git a/services/sync/services-sync.js b/services/sync/services-sync.js index 0b00a722c36..9767dc7ea7b 100644 --- a/services/sync/services-sync.js +++ b/services/sync/services-sync.js @@ -1,6 +1,4 @@ -pref("browser.places.sync.serverURL", "http://dotmoz.mozilla.org/"); +pref("browser.places.sync.serverURL", "https://services.mozilla.com/user/"); pref("browser.places.sync.username", "nobody@mozilla.com"); -pref("extensions.sync.lastversion", "firstrun"); -pref("extensions.sync.lastsync", ""); -pref("extensions.sync.remember", false); - +pref("extensions.sync.autoconnect", false); +pref("extensions.sync.lastsync", "0");