- 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
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");
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,
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));
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
#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