GUACAMOLE-197: Fix if-is-not-a-function style issues, again...

This commit is contained in:
Nick Couchman
2017-02-05 19:51:40 -05:00
committed by Nick Couchman
parent d9d5573aa4
commit efad91adb0
2 changed files with 13 additions and 13 deletions

View File

@@ -103,15 +103,15 @@ public class AuthenticationProviderService {
}
// If configure fails, permission to login is denied
if(radPack == null) {
if (radPack == null) {
logger.debug("Nothing in the RADIUS packet.");
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
}
else if(radPack instanceof AccessReject) {
else if (radPack instanceof AccessReject) {
logger.debug("Login has been rejected by RADIUS server.");
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
}
else if(radPack instanceof AccessChallenge) {
else if (radPack instanceof AccessChallenge) {
try {
String replyMsg = radPack.getAttributeValue("Reply-Message").toString();
String radState = radPack.getAttributeValue("State").toString();
@@ -127,7 +127,7 @@ public class AuthenticationProviderService {
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
}
}
else if(radPack instanceof AccessAccept) {
else if (radPack instanceof AccessAccept) {
try {
// Return AuthenticatedUser if bind succeeds

View File

@@ -132,20 +132,20 @@ public class RadiusConnectionService {
createRadiusConnection();
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
if(radiusClient == null)
if (radiusClient == null)
return null;
if(username == null || username.isEmpty()) {
if (username == null || username.isEmpty()) {
logger.warn("Anonymous access not allowed with RADIUS client.");
return null;
}
if(password == null || password.isEmpty()) {
if (password == null || password.isEmpty()) {
logger.warn("Password required for RADIUS authentication.");
return null;
}
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
if(radAuth == null)
if (radAuth == null)
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
try {
AttributeList radAttrs = new AttributeList();
@@ -175,24 +175,24 @@ public class RadiusConnectionService {
createRadiusConnection();
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
if(radiusClient == null)
if (radiusClient == null)
return null;
if(username == null || username.isEmpty()) {
if (username == null || username.isEmpty()) {
logger.warn("Anonymous access not allowed with RADIUS client.");
return null;
}
if(state == null || state.isEmpty()) {
if (state == null || state.isEmpty()) {
logger.warn("This method needs a previous RADIUS state to respond to.");
return null;
}
if(response == null || response.isEmpty()) {
if (response == null || response.isEmpty()) {
logger.warn("Response required for RADIUS authentication.");
return null;
}
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
if(radAuth == null)
if (radAuth == null)
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
try {
AttributeList radAttrs = new AttributeList();