--- gdm-2.29.92/gui/simple-greeter/Makefile.am-orig	2010-03-26 17:52:50.827743561 -0500
+++ gdm-2.29.92/gui/simple-greeter/Makefile.am	2010-03-26 17:53:46.290434166 -0500
@@ -190,6 +190,7 @@ test_language_chooser_SOURCES = 	\
 
 test_language_chooser_LDADD =	\
 	$(GTK_LIBS)		\
+	$(GCONF_LIBS)		\
 	$(top_builddir)/common/libgdmcommon.la	\
 	$(COMMON_LIBS) \
 	$(NULL)
@@ -214,6 +215,7 @@ test_layout_chooser_SOURCES = 	\
 
 test_layout_chooser_LDADD =		\
 	$(GTK_LIBS)			\
+	$(GCONF_LIBS)			\
 	$(top_builddir)/common/libgdmcommon.la	\
 	$(LIBXKLAVIER_LIBS)		\
 	$(NULL)
--- gdm-2.29.92/gui/simple-greeter/gdm-greeter-login-window.c-orig	2010-03-26 17:52:58.872213692 -0500
+++ gdm-2.29.92/gui/simple-greeter/gdm-greeter-login-window.c	2010-03-26 18:43:02.643572040 -0500
@@ -82,16 +82,18 @@
 #define KEY_BANNER_MESSAGE_TEXT     KEY_GREETER_DIR "/banner_message_text"
 #define KEY_BANNER_MESSAGE_TEXT_NOCHOOSER     KEY_GREETER_DIR "/banner_message_text_nochooser"
 #define KEY_LOGO                    KEY_GREETER_DIR "/logo_icon_name"
+#define KEY_DISABLE_USER_LIST       "/apps/gdm/simple-greeter/disable_user_list"
+
 #define GDM_GREETER_LOGIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_GREETER_LOGIN_WINDOW, GdmGreeterLoginWindowPrivate))
 
 enum {
-        MODE_SELECTION = 0,
+        MODE_UNDEFINED = 0,
+        MODE_SELECTION,
         MODE_AUTHENTICATION
 };
 
 enum {
         LOGIN_BUTTON_HIDDEN = 0,
-        LOGIN_BUTTON_START_OTHER,
         LOGIN_BUTTON_ANSWER_QUERY,
         LOGIN_BUTTON_TIMED_LOGIN
 };
@@ -111,6 +113,9 @@ struct GdmGreeterLoginWindowPrivate
 
         guint            dialog_mode;
 
+        gboolean         user_list_disabled;
+        gboolean         show_cancel_button;
+
         gboolean         timed_login_already_enabled;
         gboolean         timed_login_enabled;
         guint            timed_login_delay;
@@ -369,17 +374,6 @@ on_login_button_clicked_timed_login (Gtk
 
         _gdm_greeter_login_window_set_interactive (login_window, TRUE);
 }
-static void
-on_login_button_clicked_start_other (GtkButton             *button,
-                                     GdmGreeterLoginWindow *login_window)
-{
-        g_debug ("GdmGreeterLoginWindow: starting OTHER login");
-
-        g_signal_emit (G_OBJECT (login_window), signals[USER_SELECTED],
-                       0, GDM_USER_CHOOSER_USER_OTHER);
-        g_signal_emit (login_window, signals[BEGIN_VERIFICATION], 0);
-        switch_mode (login_window, MODE_AUTHENTICATION);
-}
 
 static void
 set_log_in_button_mode (GdmGreeterLoginWindow *login_window,
@@ -400,10 +394,6 @@ set_log_in_button_mode (GdmGreeterLoginW
         case LOGIN_BUTTON_HIDDEN:
                 gtk_widget_hide (button);
                 break;
-        case LOGIN_BUTTON_START_OTHER:
-                login_window->priv->login_button_handler_id = g_signal_connect (button, "clicked", G_CALLBACK (on_login_button_clicked_start_other), login_window);
-                gtk_widget_show (button);
-                break;
         case LOGIN_BUTTON_ANSWER_QUERY:
                 login_window->priv->login_button_handler_id = g_signal_connect (button, "clicked", G_CALLBACK (on_login_button_clicked_answer_query), login_window);
                 gtk_widget_show (button);
@@ -430,7 +420,7 @@ adjust_other_login_visibility(GdmGreeter
         }
 
         if (gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (login_window->priv->user_chooser)) == 0) {
-                set_log_in_button_mode (login_window, LOGIN_BUTTON_START_OTHER);
+                set_log_in_button_mode (login_window, LOGIN_BUTTON_ANSWER_QUERY);
         } else {
                 set_log_in_button_mode (login_window, LOGIN_BUTTON_HIDDEN);
         }
@@ -443,6 +433,9 @@ switch_mode (GdmGreeterLoginWindow *logi
         const char *default_name;
         GtkWidget  *box;
 
+        /* Should never switch to MODE_UNDEFINED */
+        g_assert (number != MODE_UNDEFINED);
+
         /* we want to run this even if we're supposed to
            be in the mode already so that we reset everything
            to a known state */
@@ -460,10 +453,17 @@ switch_mode (GdmGreeterLoginWindow *logi
 
                 sensitize_widget (login_window, "disconnect-button", FALSE);
 
-                default_name = NULL;
+                /* 
+                 * Although the cancel button is not shown in the selection
+                 * dialog, the show_cancel_button flag manages when the 
+                 * cancel button is shown on subsequent PAM queries.  Set the
+                 * flag to true initially since the button should appear on
+                 * the first query, since the button takes the user back to
+                 * selection mode.
+                 */
+                login_window->priv->show_cancel_button = TRUE;
                 break;
         case MODE_AUTHENTICATION:
-                show_widget (login_window, "cancel-button", TRUE);
                 show_widget (login_window, "disconnect-button", FALSE);
                 default_name = "log-in-button";
                 break;
@@ -471,9 +471,27 @@ switch_mode (GdmGreeterLoginWindow *logi
                 g_assert_not_reached ();
         }
 
-        box = GTK_WIDGET (gtk_builder_get_object (login_window->priv->builder, "buttonbox"));
+        box = GTK_WIDGET (gtk_builder_get_object (login_window->priv->builder,
+                          "buttonbox"));
         gtk_button_box_set_layout (GTK_BUTTON_BOX (box),
-                                   (number == MODE_SELECTION) ? GTK_BUTTONBOX_SPREAD : GTK_BUTTONBOX_END );
+                                   (number == MODE_SELECTION) ?
+                                    GTK_BUTTONBOX_SPREAD :
+                                    GTK_BUTTONBOX_END );
+
+        if (default_name != NULL) {
+                GtkWidget *widget;
+
+                widget = GTK_WIDGET (gtk_builder_get_object (login_window->priv->builder, default_name));
+                gtk_widget_grab_default (widget);
+        }
+
+        /*
+         * The rest of this function sets up the user list, so just return if
+         * the user list is disabled.
+         */
+        if (login_window->priv->user_list_disabled) {
+                return;
+        }
 
         box = gtk_widget_get_parent (login_window->priv->user_chooser);
         if (GTK_IS_BOX (box)) {
@@ -493,13 +511,6 @@ switch_mode (GdmGreeterLoginWindow *logi
                                            padding,
                                            pack_type);
         }
-
-        if (default_name != NULL) {
-                GtkWidget *widget;
-
-                widget = GTK_WIDGET (gtk_builder_get_object (login_window->priv->builder, default_name));
-                gtk_widget_grab_default (widget);
-        }
 }
 
 static void
@@ -525,6 +536,8 @@ reset_dialog (GdmGreeterLoginWindow *log
         set_busy (login_window);
         set_sensitive (login_window, FALSE);
 
+        login_window->priv->show_cancel_button = FALSE;
+
         if (login_window->priv->timed_login_enabled) {
                 gdm_chooser_widget_set_item_timer (GDM_CHOOSER_WIDGET (login_window->priv->user_chooser),
                                                    GDM_USER_CHOOSER_USER_AUTO, 0);
@@ -554,7 +567,11 @@ reset_dialog (GdmGreeterLoginWindow *log
         label = GTK_WIDGET (gtk_builder_get_object (GDM_GREETER_LOGIN_WINDOW (login_window)->priv->builder, "auth-prompt-label"));
         gtk_label_set_text (GTK_LABEL (label), "");
 
-        switch_mode (login_window, MODE_SELECTION);
+        if (login_window->priv->user_list_disabled) {
+                switch_mode (login_window, MODE_AUTHENTICATION);
+        } else {
+                switch_mode (login_window, MODE_SELECTION);
+        }
 
         set_sensitive (login_window, TRUE);
         set_ready (login_window);
@@ -587,6 +604,14 @@ gdm_greeter_login_window_ready (GdmGreet
         set_ready (GDM_GREETER_LOGIN_WINDOW (login_window));
         set_focus (GDM_GREETER_LOGIN_WINDOW (login_window));
 
+        /* If no user list, then go ahead and start PAM conversation */
+        if (login_window->priv->user_list_disabled) {
+                g_debug ("Starting PAM conversation since user list disabled");
+                g_signal_emit (G_OBJECT (login_window), signals[USER_SELECTED],
+                               0, GDM_USER_CHOOSER_USER_OTHER);
+                g_signal_emit (login_window, signals[BEGIN_VERIFICATION], 0);
+        }
+
         return TRUE;
 }
 
@@ -650,7 +675,7 @@ gdm_greeter_login_window_problem (GdmGre
         gtk_widget_show (hbox);
 
         image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
-	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
         gtk_widget_show (image);
 
         vbox = gtk_vbox_new (FALSE, 6);
@@ -775,6 +800,21 @@ gdm_greeter_login_window_start_session_w
         }
 }
 
+static void
+_show_cancel_button (GdmGreeterLoginWindow *login_window)
+{
+        /*
+         * If show_cancel_button is false, this is because the face browser
+         * is disabled and the first query is showing.  It does not make sense
+         * to display the cancel button when showing the initial query and
+         * the face browser is disabled.  Set the flag to true so that the
+         * button is shown on following queries.
+         */
+        show_widget (login_window, "cancel-button",
+                     login_window->priv->show_cancel_button);
+        login_window->priv->show_cancel_button = TRUE;
+}
+
 gboolean
 gdm_greeter_login_window_info_query (GdmGreeterLoginWindow *login_window,
                                      const char            *text)
@@ -784,6 +824,8 @@ gdm_greeter_login_window_info_query (Gdm
 
         g_return_val_if_fail (GDM_IS_GREETER_LOGIN_WINDOW (login_window), FALSE);
 
+        _show_cancel_button (login_window);
+
         g_debug ("GdmGreeterLoginWindow: info query: %s", text);
 
         entry = GTK_WIDGET (gtk_builder_get_object (GDM_GREETER_LOGIN_WINDOW (login_window)->priv->builder, "auth-prompt-entry"));
@@ -813,6 +855,8 @@ gdm_greeter_login_window_secret_info_que
 
         g_return_val_if_fail (GDM_IS_GREETER_LOGIN_WINDOW (login_window), FALSE);
 
+        _show_cancel_button (login_window);
+
         entry = GTK_WIDGET (gtk_builder_get_object (GDM_GREETER_LOGIN_WINDOW (login_window)->priv->builder, "auth-prompt-entry"));
         delete_entry_text (entry);
         gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
@@ -1188,7 +1232,9 @@ load_theme (GdmGreeterLoginWindow *login
                                  G_CALLBACK (on_user_chooser_visibility_changed),
                                  login_window);
 
-        gtk_widget_show (login_window->priv->user_chooser);
+        if (!login_window->priv->user_list_disabled) {
+                gtk_widget_show (login_window->priv->user_chooser);
+        }
 
         login_window->priv->auth_banner_label = GTK_WIDGET (gtk_builder_get_object (login_window->priv->builder, "auth-banner-label"));
         /*make_label_small_italic (login_window->priv->auth_banner_label);*/
@@ -1210,6 +1256,12 @@ load_theme (GdmGreeterLoginWindow *login
         g_signal_connect (box, "button-press-event", G_CALLBACK (on_computer_info_label_button_press), login_window);
 
         switch_mode (login_window, MODE_SELECTION);
+        if (login_window->priv->user_list_disabled) {
+                switch_mode (login_window, MODE_AUTHENTICATION);
+        } else {
+                switch_mode (login_window, MODE_SELECTION);
+        }
+
         gdk_color_parse ("white", &color);
         gtk_widget_modify_fg (login_window->priv->auth_banner_label, GTK_STATE_NORMAL, &color);
         gtk_widget_modify_fg (gtk_builder_get_object (login_window->priv->builder, "computer-info-name-label"), GTK_STATE_NORMAL, &color);
@@ -1548,13 +1600,42 @@ on_window_state_event (GtkWidget        
 static void
 gdm_greeter_login_window_init (GdmGreeterLoginWindow *login_window)
 {
+        GConfClient    *client;
+        GError         *error;
+        gboolean        user_list_disable;
+        gboolean        timed_login_enable;
+
         gdm_profile_start (NULL);
 
         login_window->priv = GDM_GREETER_LOGIN_WINDOW_GET_PRIVATE (login_window);
 
         login_window->priv->timed_login_enabled = FALSE;
 
-        login_window->priv->dialog_mode = MODE_SELECTION;
+        client = gconf_client_get_default ();
+        error = NULL;
+
+        /* The user list is not shown only if the user list is disabled and
+         * timed login is also not being used.
+         */
+        user_list_disable = gconf_client_get_bool (client,
+                KEY_DISABLE_USER_LIST, &error);
+        if (error != NULL) {
+                g_debug ("GdmUserChooserWidget: unable to get disable-user-list configuration: %s", error->message);
+                g_error_free (error);
+        }
+
+        gdm_settings_client_get_boolean (GDM_KEY_TIMED_LOGIN_ENABLE,
+                                         &timed_login_enable);
+
+        login_window->priv->dialog_mode = MODE_UNDEFINED;
+
+        login_window->priv->user_list_disabled = FALSE;
+        if (user_list_disable && !timed_login_enable) {
+                g_debug ("Disabling user list");
+                login_window->priv->user_list_disabled = TRUE;
+        } else {
+                g_debug ("Enabling user list");
+        }
 
         gtk_window_set_title (GTK_WINDOW (login_window), _("Login Window"));
         /*gtk_window_set_opacity (GTK_WINDOW (login_window), 0.85);*/
