}
else
{
if (pwPolicyErrorType == PasswordPolicyErrorType.PASSWORD_EXPIRED)
{
addResponseControl(new PasswordExpiredControl());
}
else if (pwPolicyWarningType ==
PasswordPolicyWarningType.TIME_BEFORE_EXPIRATION)
{
addResponseControl(new PasswordExpiringControl(pwPolicyWarningValue));
}
else if (mustChangePassword)
{
addResponseControl(new PasswordExpiredControl());
}
}
}
else
{
if (pwPolicyControlRequested)
{
PasswordPolicyResponseControl pwpControl =
new PasswordPolicyResponseControl(pwPolicyWarningType,
pwPolicyWarningValue,
pwPolicyErrorType);
addResponseControl(pwpControl);
}
else
{
if (pwPolicyErrorType == PasswordPolicyErrorType.PASSWORD_EXPIRED)
{
addResponseControl(new PasswordExpiredControl());
}
}
}
}