Added condition to method isLdapUser to check configuration
FEA: ItEr76S12LdapAuthentication
This commit is contained in:
parent
ad379e4ec7
commit
46e0065151
3 changed files with 17 additions and 2 deletions
|
|
@ -42,4 +42,6 @@ public interface IPasswordModel {
|
|||
|
||||
boolean validateCurrentPassword(String value);
|
||||
|
||||
boolean isLdapAuthEnabled();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,9 @@ public class PasswordController extends GenericForwardComposer {
|
|||
passwordModel.setPassword(password);
|
||||
}
|
||||
|
||||
public boolean getLdapUser() {
|
||||
return !UserUtil.getUserFromSession().isLibrePlanUser();
|
||||
public boolean isLdapUser() {
|
||||
return (!UserUtil.getUserFromSession().isLibrePlanUser() && passwordModel
|
||||
.isLdapAuthEnabled());
|
||||
}
|
||||
|
||||
public Constraint validatePasswordConfirmation() {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
package org.libreplan.web.users.settings;
|
||||
|
||||
import org.libreplan.business.common.Configuration;
|
||||
import org.libreplan.business.common.daos.IConfigurationDAO;
|
||||
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.libreplan.business.common.exceptions.ValidationException;
|
||||
import org.libreplan.business.users.daos.IUserDAO;
|
||||
|
|
@ -50,6 +51,9 @@ public class PasswordModel implements IPasswordModel {
|
|||
@Autowired
|
||||
private IUserDAO userDAO;
|
||||
|
||||
@Autowired
|
||||
private IConfigurationDAO configurationDAO;
|
||||
|
||||
private User user;
|
||||
|
||||
@Autowired
|
||||
|
|
@ -143,4 +147,12 @@ public class PasswordModel implements IPasswordModel {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public boolean isLdapAuthEnabled() {
|
||||
return configurationDAO.getConfiguration().getLdapConfiguration()
|
||||
.getLdapAuthEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue