mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
Merge pull request #42 from glyptodon/fix-object-move
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());
|
existingConnection.setName(connection.getName());
|
||||||
connectionDirectory.update(existingConnection);
|
connectionDirectory.update(existingConnection);
|
||||||
|
|
||||||
// Update connection parent
|
// Get old and new parents
|
||||||
|
String oldParentIdentifier = existingConnection.getParentIdentifier();
|
||||||
ConnectionGroup updatedParentGroup = retrievalService.retrieveConnectionGroup(userContext, connection.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());
|
existingConnectionGroup.setType(connectionGroup.getType());
|
||||||
connectionGroupDirectory.update(existingConnectionGroup);
|
connectionGroupDirectory.update(existingConnectionGroup);
|
||||||
|
|
||||||
// Update connection group parent
|
// Get old and new parents
|
||||||
|
String oldParentIdentifier = existingConnectionGroup.getParentIdentifier();
|
||||||
ConnectionGroup updatedParentGroup = retrievalService.retrieveConnectionGroup(userContext, connectionGroup.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