[gdm] show the username input box when there's no local user
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] show the username input box when there's no local user
- Date: Tue, 22 Jun 2010 02:44:47 +0000 (UTC)
commit 14b7f7ea88f1d8013d8e641f5ae69413f7cb2492
Author: Vincent Untz <vuntz gnome org>
Date: Mon Jun 21 22:37:08 2010 -0400
show the username input box when there's no local user
When a system is configured for NIS so doesn't have any local users besides root,
the greeter only shows a lone 'login' button and the waiting
cursor but is empty otherwise. Ie there is no way to enter a user name.
Pressing the login button leads to X restart.
My guess is that commits 5f8723c4fccff6aed79edbe635e3e16fa74a42d1 and
6ef14933e32173235eaafb0bc9d7188accce3364 introduced this bug.
https://bugzilla.gnome.org/show_bug.cgi?id=622069
gui/simple-greeter/gdm-chooser-widget.c | 1 +
gui/simple-greeter/gdm-greeter-login-window.c | 26 ++++++++++++++++++++----
2 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index ed4a3c1..e25cf07 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -2749,6 +2749,7 @@ gdm_chooser_widget_propagate_pending_key_events (GdmChooserWidget *widget)
void
gdm_chooser_widget_loaded (GdmChooserWidget *widget)
{
+ update_chooser_visibility (widget);
g_signal_emit (widget, signals[LOADED], 0);
queue_move_cursor_to_top (widget);
}
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index fc9c7e3..976ae9f 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -443,8 +443,15 @@ set_log_in_button_mode (GdmGreeterLoginWindow *login_window,
}
}
+static gboolean
+user_chooser_has_no_user (GdmGreeterLoginWindow *login_window)
+{
+ return (login_window->priv->user_chooser_loaded &&
+ gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (login_window->priv->user_chooser)) == 0);
+}
+
static void
-adjust_other_login_visibility(GdmGreeterLoginWindow *login_window)
+adjust_other_login_visibility (GdmGreeterLoginWindow *login_window)
{
if (! login_window->priv->user_chooser_loaded) {
return;
@@ -641,7 +648,7 @@ reset_dialog (GdmGreeterLoginWindow *login_window,
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), "");
- if (login_window->priv->user_list_disabled) {
+ if (login_window->priv->user_list_disabled || user_chooser_has_no_user (login_window)) {
switch_mode (login_window, MODE_AUTHENTICATION);
} else {
switch_mode (login_window, dialog_mode);
@@ -682,7 +689,7 @@ gdm_greeter_login_window_ready (GdmGreeterLoginWindow *login_window)
retry_login (login_window);
} else {
/* If the user list is disabled, then start the PAM conversation */
- if (login_window->priv->user_list_disabled) {
+ if (login_window->priv->user_list_disabled || user_chooser_has_no_user (login_window)) {
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);
@@ -996,7 +1003,16 @@ on_users_loaded (GdmUserChooserWidget *user_chooser,
update_banner_message (login_window);
adjust_other_login_visibility (login_window);
- gdm_chooser_widget_activate_if_one_item (GDM_CHOOSER_WIDGET (login_window->priv->user_chooser));
+ if (user_chooser_has_no_user (login_window)) {
+ /* There's no face browser to show */
+ login_window->priv->show_cancel_button = FALSE;
+ switch_mode (login_window, MODE_AUTHENTICATION);
+
+ g_debug ("Starting PAM conversation since no local users");
+ 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);
+ }
}
static void
@@ -1375,7 +1391,7 @@ update_banner_message (GdmGreeterLoginWindow *login_window)
} else {
char *message = NULL;
error = NULL;
- if (login_window->priv->user_chooser_loaded && gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (login_window->priv->user_chooser)) == 0) {
+ if (user_chooser_has_no_user (login_window)) {
message = gconf_client_get_string (login_window->priv->client, KEY_BANNER_MESSAGE_TEXT_NOCHOOSER, &error);
if (error != NULL) {
g_debug("GdmGreeterLoginWindow: unable to get nochooser banner text: %s", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]