[gnome-control-center/gnome-3-8] user-accounts: Validate real name on change



commit 840abcd92b80a6098345d29a03f37de25f01a3cf
Author: Chris Cummins <christopher e cummins intel com>
Date:   Wed May 8 17:05:56 2013 +0100

    user-accounts: Validate real name on change
    
    This prevents users from setting invalid real names for accounts by
    editing the name from the user panel. This applies the same check as is
    done when first adding the account.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699940

 panels/user-accounts/um-user-panel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 786fae9..2de2ab8 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -720,7 +720,8 @@ change_name_done (GtkWidget          *entry,
         user = get_selected_user (d);
 
         text = cc_editable_entry_get_text (CC_EDITABLE_ENTRY (entry));
-        if (g_strcmp0 (text, act_user_get_real_name (user)) != 0) {
+        if (g_strcmp0 (text, act_user_get_real_name (user)) != 0 &&
+            is_valid_name (text)) {
                 act_user_set_real_name (user, text);
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]