aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-29 21:03:36 -0500
committerTed Gould <ted@canonical.com>2009-09-29 21:03:36 -0500
commit13cb4dfa96124d14aaf86b422ff47c481acbcd49 (patch)
tree4c94b1c07cbfd450bbd3c8252ef7c30376a13937
parent2ff3e61bdd08c34f49a8c6bdc4d091ccecf446cc (diff)
downloadayatana-indicator-session-13cb4dfa96124d14aaf86b422ff47c481acbcd49.tar.gz
ayatana-indicator-session-13cb4dfa96124d14aaf86b422ff47c481acbcd49.tar.bz2
ayatana-indicator-session-13cb4dfa96124d14aaf86b422ff47c481acbcd49.zip
Checking to see if we're the guest user. No locking the guest.
-rw-r--r--src/users-service.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/users-service.c b/src/users-service.c
index 894b832..9877ba6 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -54,6 +54,7 @@ static GMainLoop *mainloop = NULL;
static UsersServiceDbus *dbus_interface = NULL;
static DbusmenuMenuitem *lock_menuitem = NULL;
+static gboolean is_guest = FALSE;
static DBusGProxy * gdm_settings_proxy = NULL;
static gboolean gdm_auto_login = FALSE;
@@ -81,7 +82,7 @@ gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old,
}
if (lock_menuitem != NULL) {
- if (gdm_auto_login) {
+ if (gdm_auto_login || is_guest) {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
} else {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
@@ -291,7 +292,7 @@ rebuild_items (DbusmenuMenuitem *root,
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
dbusmenu_menuitem_child_append(root, lock_menuitem);
- if (gdm_auto_login) {
+ if (gdm_auto_login || is_guest) {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
} else {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
@@ -409,6 +410,10 @@ main (int argc, char ** argv)
return 1;
}
+ if (!g_strcmp0(g_get_user_name(), "guest")) {
+ is_guest = TRUE;
+ }
+
g_idle_add(build_gdm_proxy, NULL);
dbus_interface = g_object_new (USERS_SERVICE_DBUS_TYPE, NULL);