continue security update

This commit is contained in:
Admin
2017-03-28 16:39:30 -05:00
parent 895a9ec99b
commit c275926117
9 changed files with 252 additions and 92 deletions

View File

@@ -133,21 +133,29 @@ public class BridgeSecurity {
theInfo.setSecure(isSecure());
return theInfo;
}
public boolean validatePassword(User targetUser) throws IOException {
if(targetUser != null) {
User theUser = securityDescriptor.getUsers().get(targetUser.getUsername());
if(theUser.getPassword() != null) {
theUser.setPassword2(targetUser.getPassword());
if(theUser.validatePassword()) {
theUser.setPassword2(null);
return true;
public LoginResult validatePassword(User targetUser) throws IOException {
LoginResult result = new LoginResult();
if(targetUser != null && targetUser.getUsername() != null) {
if(securityDescriptor.getUsers() != null && securityDescriptor.getUsers().get(targetUser.getUsername()) != null) {
User theUser = securityDescriptor.getUsers().get(targetUser.getUsername());
if(theUser.getPassword() != null) {
theUser.setPassword2(targetUser.getPassword());
if(theUser.validatePassword()) {
theUser.setPassword2(null);
result.setUser(targetUser);
}
else
result.setError("user or password not correct");
} else {
result.setError("input password is not set....");
}
} else {
log.warn("validating password when password is not set....");
return true;
}
else
result.setError("user or password not correct");
}
return false;
else
result.setError("input user not given");
return result;
}
public boolean isSecure() {