]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Put focus on password field when principal is set
authorBen Kaduk <kaduk@mit.edu>
Mon, 22 Jun 2015 23:11:28 +0000 (19:11 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 24 Jun 2015 21:40:38 +0000 (17:40 -0400)
In the Leash "Get Ticket" window, under some user-customized
configurations, the principal field can be pre-populated.  In this case,
it makes sense for the default focus to be on the password field,
since most users will only be using a single principal and should
go directly to typing their password.

The focus was already set to the password field in the case when
the principal was not modifiable (such as when the "Get Ticket" dialog
was opened by an application requesting a specific ticket).

(cherry picked from commit 50b3bba748084c99a339bd526ad47ecfccc09472)

ticket: 8032
version_fixed: 1.13.3
status: resolved

src/windows/leashdll/lsh_pwd.c

index 3c965b4eceb9967521bc476bf8254c7e56c3132d..ac85625a0bef272d1f1fe48887024c4959b3dc03 100644 (file)
@@ -1506,7 +1506,7 @@ AuthenticateProc(
         SetActiveWindow(hDialog);
         SetForegroundWindow(hDialog);
         /* put focus on password if princ is read-only */
-        hFocusCtrl = bReadOnlyPrinc ?
+        hFocusCtrl = (bReadOnlyPrinc || principal[0] != '\0') ?
             GetDlgItem(hDialog, IDC_EDIT_PASSWORD) : hEditCtrl;
         if (((HWND)wParam) != hFocusCtrl) {
             SetFocus(hFocusCtrl);