[gdm/multi-stack: 19/46] Initiate smart card auth when clicking on it in list



commit 6d5c31444c6b67d1f442480499a4ae5e174b4a06
Author: Ray Strode <rstrode redhat com>
Date:   Fri Feb 27 15:44:13 2009 -0500

    Initiate smart card auth when clicking on it in list

 gui/simple-greeter/gdm-greeter-login-window.c      |   24 ++++++++++++++++++++
 .../plugins/smartcard/gdm-smartcard-extension.c    |    2 +-
 2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index bbb99db..342133d 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -650,6 +650,7 @@ reset_dialog (GdmGreeterLoginWindow *login_window)
 
         switch_mode (login_window, MODE_SELECTION);
 
+        gtk_widget_set_sensitive (login_window->priv->conversation_list, TRUE);
         set_sensitive (login_window, TRUE);
         set_ready (login_window);
         set_focus (GDM_GREETER_LOGIN_WINDOW (login_window));
@@ -1143,6 +1144,7 @@ static void
 on_user_chooser_activated (GdmUserChooserWidget  *user_chooser,
                            GdmGreeterLoginWindow *login_window)
 {
+        char *user_name;
         char *item_id;
 
         user_name = gdm_user_chooser_widget_get_chosen_user_name (GDM_USER_CHOOSER_WIDGET (login_window->priv->user_chooser));
@@ -1176,6 +1178,28 @@ on_user_chooser_activated (GdmUserChooserWidget  *user_chooser,
                 set_log_in_button_mode (login_window, LOGIN_BUTTON_TIMED_LOGIN);
                 set_message (login_window, _("Select language and click Log In"));
                 g_free (item_id);
+        } else {
+                GdmTask *task;
+
+                task = gdm_task_list_foreach_task (GDM_TASK_LIST (login_window->priv->conversation_list),
+                                                   (GdmTaskListForeachFunc)
+                                                   task_has_service_name,
+                                                   (gpointer) item_id);
+
+                if (task == NULL) {
+                        g_debug ("GdmGreeterLoginWindow: %s has no task associated with it", item_id);
+                        g_free (item_id);
+                        return;
+                }
+                g_debug ("GdmGreeterLoginWindow: Beginning auth conversation for item %s", item_id);
+
+                /* FIXME: we should probably give the plugin more say for
+                 * what happens here.
+                 */
+                g_signal_emit (login_window, signals[BEGIN_VERIFICATION], 0, item_id);
+                g_free (item_id);
+
+                gtk_widget_set_sensitive (login_window->priv->conversation_list, FALSE);
         }
 
         g_debug ("GdmGreeterLoginWindow: Switching to shrunken authentication mode");
diff --git a/gui/simple-greeter/plugins/smartcard/gdm-smartcard-extension.c b/gui/simple-greeter/plugins/smartcard/gdm-smartcard-extension.c
index 25d5de4..a9e41f4 100644
--- a/gui/simple-greeter/plugins/smartcard/gdm-smartcard-extension.c
+++ b/gui/simple-greeter/plugins/smartcard/gdm-smartcard-extension.c
@@ -103,7 +103,7 @@ on_smartcard_event (GIOChannel   *io_channel,
 
                 if (extension->priv->number_of_tokens == 1) {
                         gdm_conversation_choose_user (GDM_CONVERSATION (extension),
-                                                      GDM_CONVERSATION_OTHER_USER);
+                                                      PAMSERVICENAME);
                 } else if (extension->priv->number_of_tokens == 0) {
                         gdm_conversation_cancel (GDM_CONVERSATION (extension));
                 }



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