diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-02-11 15:07:21 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-02-11 15:07:21 -0500 |
commit | 7c2a8317e5ac4af9d2d8a6e865a3387242f1bf3e (patch) | |
tree | cdc50b2cf1831760c6022cf355a95bc644104b38 /src/users-service-dbus.c | |
parent | 1204ae96cae80c5ab4fd0d41483310f9b82efa28 (diff) | |
parent | 0220665c7ca73221e549e0f612cd16c06c93b906 (diff) | |
download | ayatana-indicator-session-7c2a8317e5ac4af9d2d8a6e865a3387242f1bf3e.tar.gz ayatana-indicator-session-7c2a8317e5ac4af9d2d8a6e865a3387242f1bf3e.tar.bz2 ayatana-indicator-session-7c2a8317e5ac4af9d2d8a6e865a3387242f1bf3e.zip |
releasing version 0.2.2-0ubuntu1
Diffstat (limited to 'src/users-service-dbus.c')
-rw-r--r-- | src/users-service-dbus.c | 66 |
1 files changed, 7 insertions, 59 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index e05eaf5..d377089 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -443,37 +443,6 @@ get_unix_user (UsersServiceDbus *service, return TRUE; } -static gchar * -get_session_for_user (UsersServiceDbus *service, - UserData *user) -{ - GList *l; - - if (!users_service_dbus_can_activate_session (service)) - { - return NULL; - } - - if (!user->sessions || g_list_length (user->sessions) == 0) - { - return NULL; - } - - for (l = user->sessions; l != NULL; l = l->next) - { - const char *ssid; - - ssid = l->data; - - if (ssid) - { - return g_strdup (ssid); - } - } - - return NULL; -} - static gboolean do_add_session (UsersServiceDbus *service, UserData *user, @@ -1035,17 +1004,6 @@ users_service_dbus_get_user_list (UsersServiceDbus *self) return g_hash_table_get_values (priv->users); } -/* - * XXX - TODO: Right now we switch to a session that another user - * already has open, but if there are no open sessions - * for this user we go to the login screen and the - * user at the seat must select a user and enter a - * password. This kind of defeats the purpose of - * actually selecting a username, since selecting any - * user will do the same thing here. We need to change - * it so you only need to enter a password for the - * specified user. - */ gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user) @@ -1054,32 +1012,20 @@ users_service_dbus_activate_user_session (UsersServiceDbus *self, DBusMessage *message = NULL; DBusMessage *reply = NULL; DBusError error; - gchar *ssid; dbus_error_init (&error); - if (!priv->seat) - priv->seat = get_seat (self); - - ssid = get_session_for_user (self, user); - - if (!ssid) - { - return start_new_user_session (self, user); - } - - if (!(message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", - priv->seat, - "org.freedesktop.ConsoleKit.Seat", - "ActivateSession"))) + if (!(message = dbus_message_new_method_call ("org.gnome.DisplayManager", + "/org/gnome/DisplayManager/LocalDisplayFactory", + "org.gnome.DisplayManager.LocalDisplayFactory", + "SwitchToUser"))) { g_warning ("failed to create new message"); return FALSE; } if (!dbus_message_append_args (message, - DBUS_TYPE_OBJECT_PATH, - &ssid, + DBUS_TYPE_STRING, &user->user_name, DBUS_TYPE_INVALID)) { g_warning ("failed to append args"); @@ -1110,6 +1056,8 @@ users_service_dbus_activate_user_session (UsersServiceDbus *self, dbus_message_unref (reply); } + dbus_error_free (&error); + return TRUE; } |