From 44e381152049637bbfcfaed5a80c49bad3ed711f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 22 Aug 2013 16:18:20 -0400 Subject: [PATCH] loginDialog: ask for username up front if disable-user-list==TRUE Right now, we rely on PAM to ask for the username if disable-user-list is TRUE. This is suboptimal because it means we can't check if we should show a session menu. This commit changes disable-user-list==TRUE to ask for a username up front, rather than have PAM do it. https://bugzilla.gnome.org/show_bug.cgi?id=706607 --- js/gdm/loginDialog.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index d4ff019af..c6c4f02d3 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -591,11 +591,14 @@ const LoginDialog = new Lang.Class({ this._user = null; - if (!this._disableUserList && - beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) - this._showUserList(); - else + if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) { + if (!this._disableUserList) + this._showUserList(); + else + this._hideUserListAskForUsernameAndBeginVerification(); + } else { this._hideUserListAndBeginVerification(); + } }, _onDefaultSessionChanged: function(client, sessionId) { @@ -606,7 +609,7 @@ const LoginDialog = new Lang.Class({ if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFYING) return false; - if (this._user && this._user.is_logged_in()) + if (this._user && this._user.is_loaded && this._user.is_logged_in()) return false; return true; @@ -650,6 +653,7 @@ const LoginDialog = new Lang.Class({ this._authPrompt.disconnect(nextSignalId); this._authPrompt.updateSensitivity(false); let answer = this._authPrompt.getAnswer(); + this._user = this._userManager.get_user(answer); this._authPrompt.clear(); this._authPrompt.startSpinning(); this._authPrompt.begin({ userName: answer });