GNOME Bugzilla – Bug 644765
Fallback from real name to username if real name is empty
Last modified: 2011-03-21 18:40:58 UTC
My test user doesn't have a real name set, it gets an empty string, which makes the status menu strange, and the endSessionDialog very strange (" will be logged out...").
Created attachment 183385 [details] [review] Fallback from real name to username in status menu if real name is empty
Created attachment 183386 [details] [review] Fallback from real name to username in logout dialog if real name is empty
Can we fix this inside GdmUserManager and then remove the workaround in js/ui/polkitAuthenticationAgent.js rather than duplicating the logic in 3 places? If GDM needs get_real_name() to return "", then it's probably better to add get_display_name() rather than diverging in our code.
src/gdmuser/gdm-user.c makes a call to AccountsService, but reading accountsservice code I can't understand how it gets set to an empty string, at this hour at least.
Given GDM doesn't use GdmUserManager anymore, we should probably not be using it it in the shell either. Of course, that doesn't solve the original modify-in-3-places problem since GDM does the equivalent check on the output of accounts service. So, I think we need to 1) Add get_display_name() to the accounts service client lib 2) drop gdmuser from the shell and use the client lib
Ah actually, we already have this: const char * act_user_get_real_name (ActUser *user) { ... return (user->real_name ? user->real_name : user->user_name); } so maybe I should just fix that check to work rather than adding a new function
The accountsservice bit is in git now: http://cgit.freedesktop.org/accountsservice/commit/?id=ee8415ec8d8d6031fc2fee1b9f989fe53668ef47 i'll do a release at some point in the near future
I talked to owen about this, and he wants gnome-shell to work without accounts service installed until after 3.0 is released, so we'll need to go with the "muck with gdmuser" approach
Created attachment 183459 [details] [review] gdm: fix empty real name check gdm_user_get_real_name() checks for an empty real name and automatically falls back to username if real name is NULL. It doesn't automatically fall back to username if real name is empty, however. This commit makes it fall back for both cases.
Created attachment 183460 [details] [review] polkit: drop gdmuser naming workaround The polkit authentication dialog contains logic for falling back to dispalying a user's username if that user has not real name. This logic is no longer needed because gdmuser does it internally, now.
Review of attachment 183459 [details] [review]: Good, thanks!
Review of attachment 183460 [details] [review]: Looks good
*** Bug 645438 has been marked as a duplicate of this bug. ***