mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
Non domain users are created without password in case of AD auth #PL-4278
This commit is contained in:
parent
4d3788a325
commit
333be9ecae
@ -253,24 +253,27 @@ public class UserEditor extends AbstractEditor<User> {
|
||||
User user = getItem();
|
||||
|
||||
if (PersistenceHelper.isNew(user)) {
|
||||
String passw = passwField.getValue();
|
||||
String confPassw = confirmPasswField.getValue();
|
||||
if (passwField.isRequired() && (StringUtils.isBlank(passw) || StringUtils.isBlank(confPassw))) {
|
||||
String password = passwField.getValue();
|
||||
String passwordConfirmation = confirmPasswField.getValue();
|
||||
|
||||
if (passwField.isRequired() && (StringUtils.isBlank(password) || StringUtils.isBlank(passwordConfirmation))) {
|
||||
showNotification(getMessage("emptyPassword"), NotificationType.WARNING);
|
||||
return false;
|
||||
} else {
|
||||
if (StringUtils.equals(passw, confPassw)) {
|
||||
ClientConfig passwordPolicyConfig = configuration.getConfig(ClientConfig.class);
|
||||
if (passwordPolicyConfig.getPasswordPolicyEnabled()) {
|
||||
String regExp = passwordPolicyConfig.getPasswordPolicyRegExp();
|
||||
if (!passw.matches(regExp)) {
|
||||
showNotification(getMessage("simplePassword"), NotificationType.WARNING);
|
||||
return false;
|
||||
if (StringUtils.equals(password, passwordConfirmation)) {
|
||||
if (StringUtils.isNotEmpty(password)) {
|
||||
ClientConfig passwordPolicyConfig = configuration.getConfig(ClientConfig.class);
|
||||
if (passwordPolicyConfig.getPasswordPolicyEnabled()) {
|
||||
String regExp = passwordPolicyConfig.getPasswordPolicyRegExp();
|
||||
if (!password.matches(regExp)) {
|
||||
showNotification(getMessage("simplePassword"), NotificationType.WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String passwordHash = passwordEncryption.getPasswordHash(user.getId(), passw);
|
||||
user.setPassword(passwordHash);
|
||||
String passwordHash = passwordEncryption.getPasswordHash(user.getId(), password);
|
||||
user.setPassword(passwordHash);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user