Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 29593 - [autoconfig] pre-populate the users fullname in the new mail account wizard
: [autoconfig] pre-populate the users fullname in the new mail account wizard
Product: MailNews Core
Classification: Components
Component: Account Manager (show other bugs)
: Trunk
: All All
: -- enhancement with 1 vote (vote)
: Thunderbird 22.0
Assigned To: Magnus Melin
Depends on: 29594 29596 581508
  Show dependency treegraph
Reported: 2000-02-28 17:32 PST by (not reading, please use instead)
Modified: 2013-02-20 11:47 PST (History)
12 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

proposed fix (3.04 KB, patch)
2012-12-10 12:58 PST, Magnus Melin
bwinton: review+
Details | Diff | Splinter Review
proposed fix, v2 (16.84 KB, patch)
2013-01-27 03:02 PST, Magnus Melin
bwinton: review+
ben.bucksch: feedback+
Details | Diff | Splinter Review

Description (not reading, please use instead) 2000-02-28 17:32:22 PST
use nsIUserInfo to pre-populate the users fullname in the new mail account

eventually, nsIUserInfo will be extended to pre-populate more fields in the new
account wizard.

note, the implementations of nsIUserInfo are not checked in yet.
Comment 1 (not reading, please use instead) 2000-03-01 11:01:29 PST
marking m15, so that the owners of 29594 and 29596 know when I'd like to check

I have this working for unix with nsUserInfoUnix and I've got the changes to
aw-identity.js (in my local tree) so that the pre-population works on unix.

this is not a high priority bug, and it can be delayed if the mac and windows
implementations get delayed.
Comment 2 Doug Turner (:dougt) 2000-03-01 11:20:32 PST
the windows implementation of nsUserInfo is done, and I just have to change the to have it build. 
Comment 3 (not reading, please use instead) 2000-03-01 11:39:41 PST
fix in hand.
Comment 4 (not reading, please use instead) 2000-03-05 10:47:41 PST
moving to m14.
Comment 5 (not reading, please use instead) 2000-03-16 23:39:30 PST
moving out to m17.

this is not a beta2 priority feature.

it works on unix right now, but not mac or windows.
Comment 6 selmer (gone) 2000-05-06 10:39:43 PDT
Mail Review hopes this is post-beta2, easy, polish work.  Marking M18.
Comment 7 (not reading, please use instead) 2000-05-08 08:52:25 PDT
updating status whiteboard.  just waiting for the windows impl.  
Comment 8 Doug Turner (:dougt) 2000-05-08 10:51:33 PDT
I can try to take a look at this some time before m18.
Comment 9 Doug Turner (:dougt) 2000-05-18 08:48:07 PDT
I stoled the wrong bug.  Reassigning to sspitzer.
Comment 10 (not reading, please use instead) 2000-06-20 10:04:24 PDT
not going to get to the win32 implementation for 6.0

moving to future.
Comment 11 (not reading, please use instead) 2000-11-06 09:52:18 PST
adding mike to the cc list.

I guess I'm the on the hook to get this working for win32.

law, you interested in the win32 implementation?
Comment 12 Bill Law 2000-11-06 12:17:23 PST
Sure.  I'll add it to my/our list for the next train.
Comment 13 Ludovic Hirlimann [:Usul] 2009-05-20 06:25:27 PDT
I'm pretty sure this is now properly covered by the new autoconfig dialogs.
Comment 14 Magnus Melin 2009-05-21 06:59:36 PDT
Not on linux, at least.
Comment 15 Ben Bucksch (:BenB) 2010-07-23 11:32:48 PDT
|nsIUserInfo.fullname| works for me on Linux.
Mac looks implemented, too, but can't test.
Win32 is still not implemented. :-(
Filed bug 581508 about Win32.
Comment 16 Ben Bucksch (:BenB) 2010-07-23 11:35:32 PDT
Bug 561531 is about username.
(Neither username nor email address should be filled in blindly from the OS, because it's very likely to be wrong (e.g. "ben@(none)" for me), and definitely wrong for users with multiple email accounts. That bug asks to allow *specific* configs for some domains to use the OS username as placeholder.)
Comment 17 Magnus Melin 2012-12-10 12:58:36 PST
Created attachment 690524 [details] [diff] [review]
proposed fix
Comment 18 Blake Winton (:bwinton) (:☕️) 2013-01-01 12:49:45 PST
Comment on attachment 690524 [details] [diff] [review]
proposed fix

Huh.  It knew my name.  That's equal parts cool and creepy.  :)

>+++ b/mail/components/newmailaccount/content/accountProvisioner.js
>@@ -249,16 +249,23 @@ var EmailAccountProvisioner = {
>+    if (!name) {
>+      try {
>+        let userInfo = Components.classes[";1"]
>+                                 .getService(Components.interfaces.nsIUserInfo);

I'ld prefer
        let userInfo = Cc[";1"].getService(Ci.nsIUserInfo);
or perhaps we could even add it to MailServices.js.

>+++ b/mailnews/base/prefs/content/accountcreation/emailWizard.js
>@@ -137,19 +137,27 @@ EmailConfigWizard.prototype =
>+      userInfo = Components.classes[";1"]
>+                           .getService(Components.interfaces.nsIUserInfo);

It looks like Cc and Ci are available here, too.

>-    this._realname = "";
>+    this._realname = (userInfo) ? userInfo.fullname : "";

If we have a userInfo object, is it guaranteed to have a non-null fullname?

r=me with those two nits fixed, and that question answered.

Comment 19 Ben Bucksch (:BenB) 2013-01-01 14:29:11 PST
> That's equal parts cool and creepy.  :)

We try to please.
Comment 20 Magnus Melin 2013-01-04 12:31:20 PST -> FIXED

I looked it up and it looks like the getters needed to be in trycatch too, at least in theory.
Comment 21 Sebastian Hengst [:aryx][:archaeopteryx] (needinfo on intermittent or backout) 2013-01-05 01:36:40 PST
This causes perma-oranges:

TEST-UNEXPECTED-FAIL | c:\talos-slave\test\build\mozmill\account\test-mail-account-setup-wizard.js | test-mail-account-setup-wizard.js::test_mail_account_setup
TEST-UNEXPECTED-FAIL | ( | Exited with code 1 during directory run
Bug 661906 - Random Orange TEST-UNEXPECTED-FAIL | ( | Exited with code 1 during test_order_of_address_books TEST-UNEXPECTED-FAIL | c:\talos-slave\test\build\mozmill\newmailaccount\test-newmailaccount.js | test-newmailaccount.js::test_search_button_disabled_if_no_query_on_init
Bug 707105 - Near-perma-orange: TEST-UNEXPECTED-FAIL | test-newmailaccount.js | test-newmailaccount.js::test_get_an_account
Bug 710912 - Permanent orange on Linux: TEST-UNEXPECTED-FAIL | test-newmailaccount.js | test_can_pref_off_account_provisioner TEST-UNEXPECTED-FAIL | ( | Exited with code 1 during directory run
Bug 661906 - Random Orange TEST-UNEXPECTED-FAIL | ( | Exited with code 1 during test_order_of_address_books
Comment 22 Magnus Melin 2013-01-06 03:24:33 PST
backed out
Comment 23 Magnus Melin 2013-01-27 03:02:12 PST
Created attachment 706858 [details] [diff] [review]
proposed fix, v2

Tests needed updating.
Successful try run:
Comment 24 Blake Winton (:bwinton) (:☕️) 2013-02-17 12:16:17 PST
Comment on attachment 706858 [details] [diff] [review]
proposed fix, v2

Given the successful try run, this is more of an rs=me.  ;)

Comment 25 Magnus Melin 2013-02-20 11:47:50 PST -> FIXED

Note You need to log in before you can comment on or make changes to this bug.