not add user unintentionally when the username is in use
When adding a user with the username which is already in use, user becomes the last letter lacking and you can add it. Results are the same username user with different name added.
If the system has a user named 'testuser', you type 'testuser' and 'testuse' is created.
This may be kind to some, but I think this will create new user uintentionally with the same 'fullname'.
You can't add the user which is in use anyway, so I propose to stop this functionality.
I studied the code and if we fix only one line, the program tells you that the user is in use and you can't click the button.
Related file: panels/user-accounts/cc-add-user-dialog.c
Related function: generate_username_choices ()
Fixed code:
diff --git a/panels/user-accounts/cc-add-user-dialog.c b/panels/user-accounts/cc-add-user-dialog.c
index 3d1daa481..80e9905d7 100644
--- a/panels/user-accounts/cc-add-user-dialog.c
+++ b/panels/user-accounts/cc-add-user-dialog.c
@@ -559,7 +559,7 @@ generate_username_choices (const gchar *name,
items = g_hash_table_new (g_str_hash, g_str_equal);
in_use = is_username_used (item0->str);
- if (!in_use && !g_ascii_isdigit (item0->str[0])) {
+ if (!g_ascii_isdigit (item0->str[0])) {
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter, 0, item0->str, -1);
g_hash_table_insert (items, item0->str, item0->str);
--