From 1ae0fadbf483128e27565baba6e8684bc5defca2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 30 Oct 2012 15:06:44 -0400 Subject: [PATCH] loginDialog: don't rely on PAM to ask for a username For the "Not Listed?" case we will need to be able to identify when the user has entered their username. Once we have a way of tracking when the username is entered, we can then defer showing the session list too early, before the user can reliably pick a session. This username tracking will also be important for implementing a disable-user-list configuration key. If the config key gets toggled off at runtime, we'll need to know if we're at a disruptive part of the authentication process or not, so we know whether we can can expose the user list right away, or wait until the authentication conversation finishes. Right now, we pass null in for an initial username, and let the PAM machinery ask the user, which means we have no good way of knowing when the username is entered. This commit changes the "Not Listed?" code to ask the user their username up front, before starting the PAM conversation in much the same way we do if the user picks a user from the user list. https://bugzilla.gnome.org/show_bug.cgi?id=660660 --- js/gdm/loginDialog.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index ffd20a01f..7c7906675 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -977,6 +977,23 @@ const LoginDialog = new Lang.Class({ return batch.run(); }, + _askForUsernameAndLogIn: function() { + this._promptLabel.set_text(_("Username: ")); + this._promptEntry.set_text(''); + this._promptEntry.clutter_text.set_password_char(''); + + let tasks = [this._showPrompt, + + function() { + let userName = this._promptEntry.get_text(); + this._promptEntry.reactive = false; + return this._beginVerificationForUser(userName); + }]; + + let batch = new Batch.ConsecutiveBatch(this, tasks); + return batch.run(); + }, + _onSessionOpened: function(client, serviceName) { this._greeter.call_start_session_when_ready_sync(serviceName, true, null); }, @@ -1122,10 +1139,7 @@ const LoginDialog = new Lang.Class({ this._fadeOutNotListedButton]), function() { - let hold = new Batch.Hold(); - - this._userVerifier.begin(null, hold); - return hold; + return this._askForUsernameAndLogIn(); }]; let batch = new Batch.ConsecutiveBatch(this, tasks);