GNOME Bugzilla – Bug 778555
don't modify pre-filled username when typing Full Name
Last modified: 2017-02-14 17:46:28 UTC
When the user has first typed Username, don't modify it automatically when the User later types Full Name, unless the username is unavailable.
Created attachment 345704 [details] [review] user-accounts: Don't modify pre-filled username If user type custom username, don't modify it automatically when changing fullname.
Created attachment 345705 [details] [review] user-accounts: Don't modify pre-filled username If user type custom username, don't modify it automatically when changing fullname.
Review of attachment 345704 [details] [review]: ::: panels/user-accounts/um-account-dialog.c @@ +429,3 @@ + gtk_entry_set_text (GTK_ENTRY (entry), ""); + } else { + generate_username_choices (name, GTK_LIST_STORE (model)); generate_username_choices has to be called in all cases
On certain conditions, I have issues with the above patch. Eg: I have already a username 'test' on my system. Create a new user, let the username be empty (so that the username will be updated with Full Name given). Give the Full Name as "Testing". The username gets stuck at 'tes'. And when I do delete the Full Name (using backspace key), the username is no longer modified, which should be, in this case. Thanks
Hmm, thanks for testing. It is not that easy as I though initially... the problem is that generate_username_choices doesn't generate any passwords in that case and the logic fails...
(In reply to Ondrej Holy from comment #5) > Hmm, thanks for testing. It is not that easy as I though initially... the > problem is that generate_username_choices doesn't generate any passwords in > that case and the logic fails... The following may be an easy fix that can be committed immediately: Don't modify current username if the resulting username would be an empty string (ie, ""). This can happen very often if the user enters his/her name in a language other than English. Thanks
Created attachment 345743 [details] [review] user-accounts: Don't modify pre-filled username Can you please test this one?
(In reply to Ondrej Holy from comment #7) > Created attachment 345743 [details] [review] [review] > user-accounts: Don't modify pre-filled username > > Can you please test this one? Sure. Seems to work fine. I didn't find any issues for any of my test cases. Shall file report if I find any, later. Thanks
Pushed with minimal changes (NULL checks before strlen() and use *foo rather than foo[0]) Attachment 345743 [details] pushed as 9440035 - user-accounts: Don't modify pre-filled username