diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index bb85159db..c769530ef 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -173,7 +173,7 @@ public class ConnectionDirectory implements Directory{ // Verify that no connection already exists with this name. MySQLConnection previousConnection = - connectionService.retrieveConnection(name, user_id, parentID); + connectionService.retrieveConnection(name, parentID, user_id); if(previousConnection != null) throw new GuacamoleClientException("That connection name is already in use."); @@ -329,7 +329,7 @@ public class ConnectionDirectory implements Directory{ // Verify that no connection already exists with this name. MySQLConnection previousConnection = - connectionService.retrieveConnection(mySQLConnection.getName(), user_id, parentID); + connectionService.retrieveConnection(mySQLConnection.getName(), parentID, user_id); if(previousConnection != null) throw new GuacamoleClientException("That connection name is already in use."); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionGroupDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionGroupDirectory.java index 25e821b40..035c02bf8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionGroupDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionGroupDirectory.java @@ -156,7 +156,7 @@ public class ConnectionGroupDirectory implements Directory allConnectionIDs = connectionService.getAllConnectionIDs(parentID); + + if(allConnectionIDs.isEmpty()) + return Collections.EMPTY_LIST; + criteria.andConnection_idIn(allConnectionIDs); } @@ -522,6 +527,10 @@ public class PermissionCheckService { // Get the IDs of all connection groups in the connection group List allConnectionGroupIDs = connectionGroupService .getAllConnectionGroupIDs(parentID); + + if(allConnectionGroupIDs.isEmpty()) + return Collections.EMPTY_LIST; + criteria.andConnection_group_idIn(allConnectionGroupIDs); }