- 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
This commit is contained in:
Eric Kohl 2014-04-19 09:09:12 +00:00
parent c023028768
commit 5888821aa4
20 changed files with 108 additions and 2 deletions

View file

@ -975,6 +975,38 @@ TRACE("Account locked!\n");
MB_OK | MB_ICONERROR); MB_OK | MB_ICONERROR);
goto done; 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 else
{ {
TRACE("Other error!\n"); TRACE("Other error!\n");
@ -1018,6 +1050,43 @@ done:
return result; 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 static INT_PTR CALLBACK
LoggedOutWindowProc( LoggedOutWindowProc(
IN HWND hwndDlg, IN HWND hwndDlg,
@ -1045,8 +1114,7 @@ LoggedOutWindowProc(
if (pgContext->bShutdownWithoutLogon == FALSE) if (pgContext->bShutdownWithoutLogon == FALSE)
EnableWindow(GetDlgItem(hwndDlg, IDC_SHUTDOWN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_SHUTDOWN), FALSE);
SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain); SetDomainComboBox(GetDlgItem(hwndDlg, IDC_LOGON_TO), pgContext);
SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_SETCURSEL, 0, 0);
SetFocus(GetDlgItem(hwndDlg, pgContext->bDontDisplayLastUserName ? IDC_USERNAME : IDC_PASSWORD)); SetFocus(GetDlgItem(hwndDlg, pgContext->bDontDisplayLastUserName ? IDC_USERNAME : IDC_PASSWORD));

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -153,6 +153,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Anmeldemeldung" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -150,6 +150,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -156,6 +156,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -148,6 +148,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -157,6 +157,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -150,6 +150,8 @@ BEGIN
IDS_LOGONTITLE "Mesaj de autentificare" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -150,6 +150,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" IDS_LOGONTITLE "Logon Message"
IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра" IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра"
IDS_LOGONUSERDISABLED "Ваш аккаунт был отключен. Пожалуйста, обратитесь к системному администратору." 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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -153,6 +153,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -151,6 +151,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -150,6 +150,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -156,6 +156,8 @@ BEGIN
IDS_LOGONTITLE "Logon Message" 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_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_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 END
/* Shutdown Dialog Strings */ /* Shutdown Dialog Strings */

View file

@ -57,6 +57,8 @@
#define IDS_LOGONTITLE 40015 #define IDS_LOGONTITLE 40015
#define IDS_LOGONWRONGUSERORPWD 40016 #define IDS_LOGONWRONGUSERORPWD 40016
#define IDS_LOGONUSERDISABLED 40017 #define IDS_LOGONUSERDISABLED 40017
#define IDS_PASSWORDMUSTCHANGE 40018
#define IDS_PASSWORDEXPIRED 40019
#define IDS_SHUTDOWN_SHUTDOWN 50000 #define IDS_SHUTDOWN_SHUTDOWN 50000
#define IDS_SHUTDOWN_LOGOFF 50001 #define IDS_SHUTDOWN_LOGOFF 50001