move account 'creation' into the service

This commit is contained in:
thunder@thunder-mbp.local 2007-10-16 01:45:57 -07:00
Родитель d69cd561f0
Коммит 0a4db4175d
2 изменённых файлов: 6 добавлений и 5 удалений

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

@ -1668,22 +1668,23 @@ DAVCollection.prototype = {
this._authProvider._authFailed = false;
let request = this._makeRequest("GET", "", cont, headers);
// This ensures the auth header is correct, and it doubles as an
// account creation request
let request = this._makeRequest("GET", "createAcct.php", cont, headers);
request.send(null);
let event = yield;
if (this._authProvider._authFailed || event.target.status >= 400)
return;
// 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
// FIXME: hack
let path = this._currentUser.split("@");
this._currentUserPath = path[0];
this._baseURL = this._baseURL + this._currentUserPath + "/";
this._baseURL = this._baseURL + "user/" + this._currentUserPath + "/";
this._loggedIn = true;
} finally {

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

@ -1,4 +1,4 @@
pref("browser.places.sync.serverURL", "https://services.mozilla.com/user/");
pref("browser.places.sync.serverURL", "https://services.mozilla.com/");
pref("browser.places.sync.username", "nobody@mozilla.com");
pref("browser.places.sync.rememberpassword", true);
pref("browser.places.sync.autoconnect", true);