[gdm/multi-stack: 13/31] Force session reset if all PAM conversations fail



commit dc057e29f0ad913edffcb202d1479e607d925199
Author: Ray Strode <rstrode redhat com>
Date:   Sat Feb 7 21:17:49 2009 -0500

    Force session reset if all PAM conversations fail

 gui/simple-greeter/gdm-greeter-login-window.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index 7853094..fb64a4a 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -669,15 +669,21 @@ reset_dialog (GdmGreeterLoginWindow *login_window)
 }
 
 static void
-do_cancel (GdmGreeterLoginWindow *login_window)
+restart_conversations (GdmGreeterLoginWindow *login_window)
 {
-        /* need to wait for response from backend */
-        set_message (login_window, _("Cancelling..."));
         set_busy (login_window);
         set_sensitive (login_window, FALSE);
         g_signal_emit (login_window, signals[CANCELLED], 0);
 }
 
+static void
+do_cancel (GdmGreeterLoginWindow *login_window)
+{
+        /* need to wait for response from backend */
+        set_message (login_window, _("Cancelling..."));
+        restart_conversations (login_window);
+}
+
 gboolean
 gdm_greeter_login_window_ready (GdmGreeterLoginWindow *login_window,
                                 const char            *service_name)
@@ -785,6 +791,16 @@ gdm_greeter_login_window_info (GdmGreeterLoginWindow *login_window,
                 g_object_unref (task);
         }
 
+        /* If every conversation has failed, then just start over.
+         */
+        task = gdm_task_list_get_active_task (GDM_TASK_LIST (login_window->priv->conversation_list));
+
+        if (!gdm_task_is_enabled (task)) {
+                g_debug ("GdmGreeterLoginWindow: No conversations left, starting over");
+                restart_conversations (login_window);
+        }
+        g_object_unref (task);
+
         return TRUE;
 }
 



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