mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-30 00:23:21 +00:00 
			
		
		
		
	GUAC-964: Only move connections/groups if parent identifier changes.
This commit is contained in:
		| @@ -309,9 +309,14 @@ public class ConnectionRESTService { | ||||
|         existingConnection.setName(connection.getName()); | ||||
|         connectionDirectory.update(existingConnection); | ||||
|  | ||||
|         // Update connection parent | ||||
|         // Get old and new parents | ||||
|         String oldParentIdentifier = existingConnection.getParentIdentifier(); | ||||
|         ConnectionGroup updatedParentGroup = retrievalService.retrieveConnectionGroup(userContext, connection.getParentIdentifier()); | ||||
|         connectionDirectory.move(connectionID, updatedParentGroup.getConnectionDirectory()); | ||||
|  | ||||
|         // Update connection parent, if changed | ||||
|         if (    (oldParentIdentifier != null && !oldParentIdentifier.equals(updatedParentGroup.getParentIdentifier())) | ||||
|              || (oldParentIdentifier == null && updatedParentGroup.getParentIdentifier() != null)) | ||||
|             connectionDirectory.move(connectionID, updatedParentGroup.getConnectionDirectory()); | ||||
|  | ||||
|     } | ||||
|      | ||||
|   | ||||
| @@ -365,9 +365,14 @@ public class ConnectionGroupRESTService { | ||||
|         existingConnectionGroup.setType(connectionGroup.getType()); | ||||
|         connectionGroupDirectory.update(existingConnectionGroup); | ||||
|  | ||||
|         // Update connection group parent | ||||
|         // Get old and new parents | ||||
|         String oldParentIdentifier = existingConnectionGroup.getParentIdentifier(); | ||||
|         ConnectionGroup updatedParentGroup = retrievalService.retrieveConnectionGroup(userContext, connectionGroup.getParentIdentifier()); | ||||
|         connectionGroupDirectory.move(connectionGroupID, updatedParentGroup.getConnectionGroupDirectory()); | ||||
|  | ||||
|         // Update connection group parent, if changed | ||||
|         if (    (oldParentIdentifier != null && !oldParentIdentifier.equals(updatedParentGroup.getParentIdentifier())) | ||||
|              || (oldParentIdentifier == null && updatedParentGroup.getParentIdentifier() != null)) | ||||
|             connectionGroupDirectory.move(connectionGroupID, updatedParentGroup.getConnectionGroupDirectory()); | ||||
|  | ||||
|     } | ||||
|      | ||||
|   | ||||
		Reference in New Issue
	
	Block a user