[MSGINA]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 19 Apr 2014 09:09:12 +0000 (09:09 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 19 Apr 2014 09:09:12 +0000 (09:09 +0000)
- Allways add the computer name to the domain list.
- Notify the user about required password changes and repeat the logon using the new password.

svn path=/trunk/; revision=62793

20 files changed:
reactos/dll/win32/msgina/gui.c
reactos/dll/win32/msgina/lang/bg-BG.rc
reactos/dll/win32/msgina/lang/cs-CZ.rc
reactos/dll/win32/msgina/lang/de-DE.rc
reactos/dll/win32/msgina/lang/en-US.rc
reactos/dll/win32/msgina/lang/es-ES.rc
reactos/dll/win32/msgina/lang/fr-FR.rc
reactos/dll/win32/msgina/lang/he-IL.rc
reactos/dll/win32/msgina/lang/id-ID.rc
reactos/dll/win32/msgina/lang/it-IT.rc
reactos/dll/win32/msgina/lang/ja-JP.rc
reactos/dll/win32/msgina/lang/no-NO.rc
reactos/dll/win32/msgina/lang/pl-PL.rc
reactos/dll/win32/msgina/lang/ro-RO.rc
reactos/dll/win32/msgina/lang/ru-RU.rc
reactos/dll/win32/msgina/lang/sk-SK.rc
reactos/dll/win32/msgina/lang/sq-AL.rc
reactos/dll/win32/msgina/lang/tr-TR.rc
reactos/dll/win32/msgina/lang/uk-UA.rc
reactos/dll/win32/msgina/resource.h

index 1bd863e..41b7689 100644 (file)
@@ -975,6 +975,38 @@ TRACE("Account locked!\n");
                                                 MB_OK | MB_ICONERROR);
             goto done;
         }
+        else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) ||
+                 (SubStatus == STATUS_PASSWORD_EXPIRED))
+        {
+            if (SubStatus == STATUS_PASSWORD_MUST_CHANGE)
+                ResourceMessageBox(pgContext,
+                                   hwndDlg,
+                                   MB_OK | MB_ICONSTOP,
+                                   IDS_LOGONTITLE,
+                                   IDS_PASSWORDMUSTCHANGE);
+            else
+                ResourceMessageBox(pgContext,
+                                   hwndDlg,
+                                   MB_OK | MB_ICONSTOP,
+                                   IDS_LOGONTITLE,
+                                   IDS_PASSWORDEXPIRED);
+
+            if (!OnChangePassword(hwndDlg,
+                                  pgContext))
+                goto done;
+
+            Status = DoLoginTasks(pgContext,
+                                  pgContext->UserName,
+                                  pgContext->Domain,
+                                  pgContext->Password,
+                                  &SubStatus);
+            if (!NT_SUCCESS(Status))
+            {
+                TRACE("Login after password change failed! (Status 0x%08lx)\n", Status);
+
+                goto done;
+            }
+        }
         else
         {
 TRACE("Other error!\n");
@@ -1018,6 +1050,43 @@ done:
     return result;
 }
 
+
+static
+VOID
+SetDomainComboBox(
+    HWND hwndDomainComboBox,
+    PGINA_CONTEXT pgContext)
+{
+    WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD dwComputerNameLength;
+    LONG lIndex = 0;
+    LONG lFindIndex;
+
+    SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0);
+
+    dwComputerNameLength = sizeof(szComputerName) / sizeof(WCHAR);
+    if (GetComputerNameW(szComputerName, &dwComputerNameLength))
+    {
+        lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName);
+    }
+
+    if (wcslen(pgContext->Domain) != 0)
+    {
+        lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->Domain);
+        if (lFindIndex == CB_ERR)
+        {
+            lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain);
+        }
+        else
+        {
+            lIndex = lFindIndex;
+        }
+    }
+
+    SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0);
+}
+
+
 static INT_PTR CALLBACK
 LoggedOutWindowProc(
     IN HWND hwndDlg,
@@ -1045,8 +1114,7 @@ LoggedOutWindowProc(
             if (pgContext->bShutdownWithoutLogon == FALSE)
                 EnableWindow(GetDlgItem(hwndDlg, IDC_SHUTDOWN), FALSE);
 
-            SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain);
-            SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_SETCURSEL, 0, 0);
+            SetDomainComboBox(GetDlgItem(hwndDlg, IDC_LOGON_TO), pgContext);
 
             SetFocus(GetDlgItem(hwndDlg, pgContext->bDontDisplayLastUserName ? IDC_USERNAME : IDC_PASSWORD));
 
index c6e4160..cee7c05 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index fb7c834..05c71e7 100644 (file)
@@ -153,6 +153,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 612afcf..e71838c 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Anmeldemeldung"
     IDS_LOGONWRONGUSERORPWD "Sie konnten nicht angemeldet werden. Prüfen Sie Benutzername und Domäne, und geben Sie das Passwort erneut ein. Bei Passworten wird Groß- und Kleinschreibung unterschieden."
     IDS_LOGONUSERDISABLED "Ihr Konto wurde deaktiviert. Wenden Sie sich an Ihren Systemadministrator."
+    IDS_PASSWORDMUSTCHANGE "Sie müssen Ihr Paasswort bei der ersten Anmeldung ändern."
+    IDS_PASSWORDEXPIRED "Ihr Passwort ist abgelaufen und muss geändert werden."
 END
 
 /* Shutdown Dialog Strings */
index b699b34..c8828ca 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 83c9cb9..45a0f3d 100644 (file)
@@ -150,6 +150,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 60b838c..4f0d324 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 89be4d6..bb76396 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 4e45a68..6e33eb6 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index a1e442e..eef95f8 100644 (file)
@@ -156,6 +156,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index b3af12c..118f1b1 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index bce3ee2..062cc61 100644 (file)
@@ -148,6 +148,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index a1d56be..80c2020 100644 (file)
@@ -157,6 +157,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 4e517e6..853a394 100644 (file)
@@ -150,6 +150,8 @@ BEGIN
     IDS_LOGONTITLE "Mesaj de autentificare"
     IDS_LOGONWRONGUSERORPWD "Sistemul nu vă poate autentifica. Asigurați-vă că numele și domeniul sunt corecte apoi tastați din nou parola. În parolă se face distincție între majuscule și minuscule."
     IDS_LOGONUSERDISABLED "Contul dumneavoastră a fost dezactivat. Contactați administratorul de sistem."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 1061218..dc7cea3 100644 (file)
@@ -150,6 +150,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра"
     IDS_LOGONUSERDISABLED "Ваш аккаунт был отключен. Пожалуйста, обратитесь к системному администратору."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index 31d4ab2..3b624ab 100644 (file)
@@ -153,6 +153,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index cb9a93f..17257a2 100644 (file)
@@ -151,6 +151,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index c216ef7..b6e731a 100644 (file)
@@ -150,6 +150,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index b125c54..191b305 100644 (file)
@@ -156,6 +156,8 @@ BEGIN
     IDS_LOGONTITLE "Logon Message"
     IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case."
     IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator."
+    IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon."
+    IDS_PASSWORDEXPIRED "Your password has expired and must be changed."
 END
 
 /* Shutdown Dialog Strings */
index e310dcf..cee14be 100644 (file)
@@ -57,6 +57,8 @@
 #define IDS_LOGONTITLE           40015
 #define IDS_LOGONWRONGUSERORPWD  40016
 #define IDS_LOGONUSERDISABLED    40017
+#define IDS_PASSWORDMUSTCHANGE   40018
+#define IDS_PASSWORDEXPIRED      40019
 
 #define IDS_SHUTDOWN_SHUTDOWN         50000
 #define IDS_SHUTDOWN_LOGOFF           50001