[gnome-control-center/T20818: 24/54] user-accounts: make the name of a shared account not editable
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/T20818: 24/54] user-accounts: make the name of a shared account not editable
- Date: Tue, 23 Jan 2018 21:32:03 +0000 (UTC)
commit 21f611aee02e44bcf8538ef1d57d2e8597de70b9
Author: Cosimo Cecchi <cosimo endlessm com>
Date: Tue May 6 14:14:03 2014 -0700
user-accounts: make the name of a shared account not editable
panels/user-accounts/um-user-panel.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 384084a..e27dc5e 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -1175,6 +1175,7 @@ on_permission_changed (GPermission *permission,
{
CcUserPanelPrivate *d = data;
gboolean is_authorized;
+ gboolean is_shared_account;
gboolean self_selected;
ActUser *user;
GtkWidget *widget;
@@ -1185,6 +1186,7 @@ on_permission_changed (GPermission *permission,
}
is_authorized = g_permission_get_allowed (G_PERMISSION (d->permission));
+ is_shared_account = g_strcmp0 (act_user_get_user_name (user), "shared") == 0;
self_selected = act_user_get_uid (user) == geteuid ();
gtk_stack_set_visible_child_name (GTK_STACK (d->headerbar_buttons), is_authorized ? PAGE_ADDUSER :
PAGE_LOCK);
@@ -1259,13 +1261,13 @@ on_permission_changed (GPermission *permission,
add_unlock_tooltip (get_widget (d, "autologin-switch"));
}
- /* The full name entry: insensitive if remote or not authorized and not self */
+ /* The full name entry: insensitive if remote or not authorized and not
+ self, or is Shared Account */
widget = get_widget (d, "full-name-entry");
if (!act_user_is_local_account (user)) {
gtk_widget_set_sensitive (widget, FALSE);
remove_unlock_tooltip (widget);
-
- } else if (is_authorized || self_selected) {
+ } else if (!is_shared_account && (is_authorized || self_selected)) {
gtk_widget_set_sensitive (widget, TRUE);
remove_unlock_tooltip (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]