afscreds-aklog-only-20040626
authorJeffrey Altman <jaltman@mit.edu>
Mon, 28 Jun 2004 17:33:20 +0000 (17:33 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 28 Jun 2004 17:33:20 +0000 (17:33 +0000)
Modify the Obtain Tokens dialog to allow a blank password
if a full principal name is provided.  (for aklog only requests)

src/WINNT/client_creds/credstab.cpp

index f6bfc44..2ab0949 100644 (file)
@@ -329,19 +329,20 @@ void NewCreds_OnInitDialog (HWND hDlg)
 
 void NewCreds_OnEnable (HWND hDlg)
 {
-   BOOL fEnable = TRUE;
-
-   TCHAR szUser[ cchRESOURCE ];
-   GetDlgItemText (hDlg, IDC_NEWCREDS_USER, szUser, cchRESOURCE);
-   if (!szUser[0])
-      fEnable = FALSE;
-
-   TCHAR szPassword[ cchRESOURCE ];
-   GetDlgItemText (hDlg, IDC_NEWCREDS_PASSWORD, szPassword, cchRESOURCE);
-   if (!szPassword[0])
-      fEnable = FALSE;
-
-   EnableWindow (GetDlgItem (hDlg, IDOK), fEnable);
+    BOOL fEnable = TRUE;
+
+    TCHAR szUser[ cchRESOURCE ];
+    GetDlgItemText (hDlg, IDC_NEWCREDS_USER, szUser, cchRESOURCE);
+    if (!szUser[0])
+        fEnable = FALSE;
+
+    if ( !strchr(szUser, '@') ) {
+        TCHAR szPassword[ cchRESOURCE ];
+        GetDlgItemText (hDlg, IDC_NEWCREDS_PASSWORD, szPassword, cchRESOURCE);
+        if (!szPassword[0])
+            fEnable = FALSE;
+    }
+    EnableWindow (GetDlgItem (hDlg, IDOK), fEnable);
 }