#630 change password on profile page
This commit is contained in:
parent
fd2e05a3a6
commit
bdb03bef36
2 changed files with 5 additions and 5 deletions
|
@ -81,10 +81,10 @@ public class UserService {
|
|||
}
|
||||
|
||||
public void changePassword(final String username, final String password) {
|
||||
ComponentUtil.getLdapManager().changePassword(username, password);
|
||||
final boolean changed = ComponentUtil.getLdapManager().changePassword(username, password);
|
||||
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
if (fessConfig.isLdapAdminEnabled(username) && fessConfig.isLdapAdminSyncPassword()) {
|
||||
if (!changed || fessConfig.isLdapAdminSyncPassword()) {
|
||||
userBhv.selectEntity(cb -> cb.query().setName_Equal(username)).ifPresent(entity -> {
|
||||
final String encodedPassword = fessLoginAssist.encryptPassword(password);
|
||||
entity.setPassword(encodedPassword);
|
||||
|
|
|
@ -915,10 +915,10 @@ public class LdapManager {
|
|||
});
|
||||
}
|
||||
|
||||
public void changePassword(final String username, final String password) {
|
||||
public boolean changePassword(final String username, final String password) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
if (!fessConfig.isLdapAdminEnabled(username)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
final Supplier<Hashtable<String, String>> adminEnv = () -> createAdminEnv();
|
||||
|
@ -932,7 +932,7 @@ public class LdapManager {
|
|||
throw new LdapOperationException("User is not found: " + username);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void insert(final String entryDN, final Attributes entry, final Supplier<Hashtable<String, String>> envSupplier) {
|
||||
|
|
Loading…
Add table
Reference in a new issue