added wizard to setup service and get login information for new users

updated server pointers to point to the new services.mozilla.com backend
This commit is contained in:
cbeard@h-135.office.mozilla.org 2007-09-26 17:34:36 -07:00
parent afd2a6c01f
commit c1801bee80
2 changed files with 27 additions and 13 deletions

View File

@ -1120,7 +1120,7 @@ DAVCollection.prototype = {
'Use your ldap username/password - dotmoz'); 'Use your ldap username/password - dotmoz');
LOG("Found " + logins.length + " logins"); 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) { if (logins[i].username == username) {
password = logins[i].password; password = logins[i].password;
break; break;
@ -1154,14 +1154,30 @@ DAVCollection.prototype = {
} }
// fixme: hacktastic // fixme: hacktastic
let hello = /Hello (.+)@mozilla.com/.exec(event.target.responseText) // let hello = /Hello (.+)@mozilla.com/.exec(event.target.responseText)
if (hello) { // let hello = /Index of/.exec(event.target.responseText)
this._currentUserPath = hello[1]; // if (hello) {
this._currentUser = this._currentUserPath + "@mozilla.com"; // this._currentUserPath = hello[1];
this._baseURL = "http://dotmoz.mozilla.org/~" + // this._currentUser = this._currentUserPath + "@mozilla.com";
this._currentUserPath + "/"; // 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; this._loggedIn = true;
if (this._loginHandlers && this._loginHandlers.load) if (this._loginHandlers && this._loginHandlers.load)

View File

@ -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("browser.places.sync.username", "nobody@mozilla.com");
pref("extensions.sync.lastversion", "firstrun"); pref("extensions.sync.autoconnect", false);
pref("extensions.sync.lastsync", ""); pref("extensions.sync.lastsync", "0");
pref("extensions.sync.remember", false);