mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-197: Fix if-is-not-a-function style issues, again...
This commit is contained in:
committed by
Nick Couchman
parent
d9d5573aa4
commit
efad91adb0
@@ -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
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user